Skip to content

fix(core): deprecated interpolation, var_dump variadic, print_r $return, array ref alias, Windows PE stub#445

Open
Guikingone wants to merge 1 commit into
illegalstudio:mainfrom
Guikingone:fix/batch-8
Open

fix(core): deprecated interpolation, var_dump variadic, print_r $return, array ref alias, Windows PE stub#445
Guikingone wants to merge 1 commit into
illegalstudio:mainfrom
Guikingone:fix/batch-8

Conversation

@Guikingone

@Guikingone Guikingone commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Closes #340, #389, #331, #379.

#340: String interpolation ${var} (deprecated)

  • Added ${expr} form to the lexer interpolation routine
  • Re-lexes the braced expression (with leading $ prepended) as a normal PHP expression
  • PHP 8.x deprecates this syntax but still supports it

#389: var_dump variadic + print_r $return mode

  • var_dump: signature changed to variadic; each operand dumped independently in source order
  • print_r: signature accepts optional $return bool; when true, captures output to a buffer
  • New globals _print_r_mode/_print_r_off/_print_r_buf redirect __rt_stdout_write and walker writes
  • New runtime helpers __rt_pr_write, __rt_pr_append, __rt_pr_finish (both AArch64 + x86_64)
  • print_r without $return now returns PHP true instead of void

#331: Reference alias to array elements (source-side)

  • $b =& $a[0] creates a reference alias from a local to an array element
  • New Op::LoadArrayElemRefCell (2 operands: array + index)
  • Type checker ArrayAccess arm in check_ref_assign
  • EIR lowering via bind_local_ref_cell_ptr (inline-storage pointer approach)
  • Codegen for AArch64 + x86_64
  • Indexed arrays only; hash arrays and target-side ($a[0] =& $b) are follow-up

#379: Windows PE stub

  • Added Platform::Windows to the enum with detect_host, php_os_name, extern_symbol, etc.
  • All Platform/Arch match arms now have a Windows arm that panics with a clear message
  • Parse windows-x86_64 / x86_64-pc-windows-msvc / x86_64-pc-windows-gnu target strings
  • supports_current_backend() returns false for Windows
  • Full Windows implementation (MSx64 ABI, PE/COFF, Win32 calls) is staged for follow-up PRs

Test results

  • cargo build: 0 errors, 0 warnings
  • printing tests: 46 passed
  • references tests: 23 passed
  • var_dump tests: 23 passed
  • interpolation tests: 45 passed
  • lexer interpolation tests: 7 passed

@Guikingone Guikingone changed the title fix(batch-8): deprecated interpolation, var_dump variadic, print_r $return, array ref alias, Windows PE stub fix(core): deprecated interpolation, var_dump variadic, print_r $return, array ref alias, Windows PE stub Jul 1, 2026
…nt_r $return, array ref alias, Windows PE stub

illegalstudio#340: Support deprecated ${expr} string interpolation in the lexer
  (PHP 8.x deprecates but supports it; re-lexes the braced expression)

illegalstudio#389: Make var_dump variadic (each arg dumped independently in source order)
  Add print_r($value, true) return mode via global _print_r_mode flag
  that redirects __rt_stdout_write and walker writes to a capture buffer

illegalstudio#331: Source-side reference alias to array elements ($b =& $a[0])
  New Op::LoadArrayElemRefCell, checker ArrayAccess arm, EIR lowering,
  codegen for AArch64 + x86_64 (inline-storage pointer approach)

illegalstudio#379: Add Platform::Windows stub with clear 'not yet supported' panics
  across all Platform/Arch match arms; parse windows-x86_64 target string
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.

String interpolation with array access emits corrupted output

1 participant