Category
language
Status (refreshed 2026-06-02 — VM done, JIT/AOT tracked in #4652)
VM eval() is implemented (#3358 closed): ext/standard/VmEval.php compiles and executes strings in the caller scope. This issue remains the umbrella for remaining eval parity; workers should claim #4652 for JIT/AOT lowering.
| Tier |
State |
| VM |
✅ repro below prints 42 |
| JIT/AOT |
❌ LogicException: eval() is VM-only — #4652 |
Problem
Zend eval() compiles and executes PHP source in the current scope, with ParseError on syntax failures. Native tiers must match or emit Zend-compatible fatals — not LogicException stubs.
php-src reference
Repro — VM (passes today)
Save as repro_eval_vm.php:
<?php
$x = 1;
eval('$x = $x + 41;');
echo $x, "\n";
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh
php bin/vm.php repro_eval_vm.php # 42
php repro_eval_vm.php # Zend: 42
'
Repro — JIT/AOT (fails — #4652)
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh
php bin/jit.php repro_eval_vm.php
php bin/compile.php repro_eval_vm.php /tmp/eval-test && /tmp/eval-test
'
Expected after #4652: 42 on all tiers.
Repro — parse error shape
<?php
try {
eval('class {');
} catch (Throwable $e) {
echo get_class($e), ':', $e->getMessage(), "\n";
}
| Engine |
Expected |
| Zend |
ParseError: ... |
| VM |
must be ParseError, not LogicException |
Scope (this repo)
| Area |
Files |
| VM |
ext/standard/VmEval.php, eval_.php — done (#3358) |
| JIT/AOT |
#4652 — eval_.php::call(), AOT runtime bridge |
| Tests |
test/compliance/cases/language/eval_*.phpt |
Done when
Links
Category
languageStatus (refreshed 2026-06-02 — VM done, JIT/AOT tracked in #4652)
VM
eval()is implemented (#3358 closed):ext/standard/VmEval.phpcompiles and executes strings in the caller scope. This issue remains the umbrella for remaining eval parity; workers should claim #4652 for JIT/AOT lowering.42LogicException: eval() is VM-only— #4652Problem
Zend
eval()compiles and executes PHP source in the current scope, withParseErroron syntax failures. Native tiers must match or emit Zend-compatible fatals — not LogicException stubs.php-src reference
ext/standard/basic_functions.c—zif_evalZend/zend_execute.c—zend_eval_stringl,zend_eval_string_exZend/zend_compile.c— runtime compilationRepro — VM (passes today)
Save as
repro_eval_vm.php:Repro — JIT/AOT (fails — #4652)
Expected after #4652:
42on all tiers.Repro — parse error shape
ParseError: ...ParseError, notLogicExceptionScope (this repo)
ext/standard/VmEval.php,eval_.php— done (#3358)eval_.php::call(), AOT runtime bridgetest/compliance/cases/language/eval_*.phptDone when
42ParseErroron VM/JIT/AOT./script/ci-fast.sh --filter eval_greenLinks