Description
Double-quoted string interpolation with array access does not match PHP. The compiler accepts the source, but the generated binary emits corrupted literal-looking output instead of the interpolated value.
Minimal reproduction
<?php
$a = ['x' => 'ok'];
echo "{$a['x']}";
Steps to reproduce
- Save as
main.php.
- Run
php main.php.
- Compile and run with elephc.
Expected behavior
PHP 8.4 prints:
Actual behavior
The elephc-compiled binary prints:
Environment
- elephc 0.23.5
- PHP 8.4.19
- macOS arm64
- reproduced on 2026-06-05
Notes
This looks like interpolation parsing/lowering is preserving fragments of the template syntax instead of evaluating the embedded array access expression.
Description
Double-quoted string interpolation with array access does not match PHP. The compiler accepts the source, but the generated binary emits corrupted literal-looking output instead of the interpolated value.
Minimal reproduction
Steps to reproduce
main.php.php main.php.Expected behavior
PHP 8.4 prints:
Actual behavior
The elephc-compiled binary prints:
Environment
Notes
This looks like interpolation parsing/lowering is preserving fragments of the template syntax instead of evaluating the embedded array access expression.