Category
language
Problem
VM eval() works after #3358 (ext/standard/VmEval.php, ext/standard/eval_.php). JIT/AOT still throw LogicException: eval() is VM-only in this compiler build (eval_.php::call()).
Scripts compiled with bin/jit.php or bin/compile.php that call eval() fail at runtime even when the eval string is statically known. Self-host bootstrap paths that rely on dynamic compilation need native-tier parity or an explicit Zend-compatible fatal.
php-src reference
Repro (failure today)
Save as repro_eval_jit.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_jit.php # prints 42
php bin/jit.php repro_eval_jit.php # LogicException: eval() is VM-only
php bin/compile.php repro_eval_jit.php /tmp/eval-test && /tmp/eval-test # same
php repro_eval_jit.php # Zend: 42
'
Parse-error repro:
<?php
try {
eval('syntax error here');
} catch (Throwable $e) {
echo get_class($e), "\n";
}
VM must match Zend ParseError class/message; JIT/AOT must not segfault.
Scope (this repo)
| Area |
Files |
Notes |
| JIT |
ext/standard/eval_.php — call() |
Invoke runtime compile helper or defer to VmEval bridge |
| AOT |
lib/AOT/runtime/ |
Same runtime compile entry as VM |
| Shared |
ext/standard/VmEval.php |
Reuse compile+execute in caller scope |
| Tests |
test/compliance/cases/language/eval_jit.phpt, AOT fixture |
|
| Policy |
lib/JIT/SelfHostBuiltinPolicy.php |
Mark eval native or document VM-only with compile-time warning |
Done when
Links
Category
languageProblem
VM
eval()works after #3358 (ext/standard/VmEval.php,ext/standard/eval_.php). JIT/AOT still throwLogicException: eval() is VM-only in this compiler build(eval_.php::call()).Scripts compiled with
bin/jit.phporbin/compile.phpthat calleval()fail at runtime even when the eval string is statically known. Self-host bootstrap paths that rely on dynamic compilation need native-tier parity or an explicit Zend-compatible fatal.php-src reference
ext/standard/basic_functions.c—zif_evalZend/zend_execute.c—zend_eval_stringlin current scopeZend/zend_compile.c— runtime compile hookRepro (failure today)
Save as
repro_eval_jit.php:Parse-error repro:
VM must match Zend
ParseErrorclass/message; JIT/AOT must not segfault.Scope (this repo)
ext/standard/eval_.php—call()VmEvalbridgelib/AOT/runtime/ext/standard/VmEval.phptest/compliance/cases/language/eval_jit.phpt, AOT fixturelib/JIT/SelfHostBuiltinPolicy.phpDone when
42underbin/jit.phpand AOT binaryParseError(not LogicException) on all tiers./script/ci-fast.sh --filter eval_greenLinks