Skip to content

feat(core) array builtin parity + indexed-scalar inputs and ownership fixes#327

Draft
Guikingone wants to merge 1 commit into
illegalstudio:mainfrom
Guikingone:feat/array-builtin-parity
Draft

feat(core) array builtin parity + indexed-scalar inputs and ownership fixes#327
Guikingone wants to merge 1 commit into
illegalstudio:mainfrom
Guikingone:feat/array-builtin-parity

Conversation

@Guikingone

Copy link
Copy Markdown
Contributor

15 PHP array builtins, dual-arch (ARM64/x86_64), tested and GC-clean: array_is_list, array_key_first/last, array_replace, array_replace_recursive, array_diff_assoc, array_intersect_assoc, array_merge_recursive, array_walk_recursive, array_find/any/all, array_udiff/uintersect, array_multisort.

Correctness fixes:

  • array_merge_recursive: persist combined-list string values (fixes a use-after-free when the temporary scalar wrappers are released).
  • Hash-based builtins persist string values into results instead of incref-sharing (fixes a latent use-after-free when an input is freed before the result).

Scalar indexed-array inputs for the 5 hash-based builtins via the new __rt_array_to_hash converter; result key/value widen to Mixed for heterogeneous inputs.

Validated on macOS ARM64, Linux x86_64, and Linux ARM64.

…rship fixes

15 PHP array builtins, dual-arch (ARM64/x86_64), tested and GC-clean:
array_is_list, array_key_first/last, array_replace, array_replace_recursive,
array_diff_assoc, array_intersect_assoc, array_merge_recursive,
array_walk_recursive, array_find/any/all, array_udiff/uintersect, array_multisort.

Correctness fixes:
- array_merge_recursive: persist combined-list string values (fixes a
  use-after-free when the temporary scalar wrappers are released).
- Hash-based builtins persist string values into results instead of
  incref-sharing (fixes a latent use-after-free when an input is freed
  before the result).

Scalar indexed-array inputs for the 5 hash-based builtins via the new
__rt_array_to_hash converter; result key/value widen to Mixed for
heterogeneous inputs.

Validated on macOS ARM64, Linux x86_64, and Linux ARM64.
@Guikingone Guikingone changed the title feat: array builtin parity (Piste A) + indexed-scalar inputs and ownership fixes feat(core) array builtin parity + indexed-scalar inputs and ownership fixes Jun 2, 2026
@nahime0

nahime0 commented Jun 12, 2026

Copy link
Copy Markdown
Member

Hi @Guikingone, I'm currently landing the new IR-based backend path on main. Feel free to mark this PR as ready for review when you're ready. I'll take care of aligning it with the new backend.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants