Category
Foundation · php-in-php · runtime-shrink · cold-build / #32122 class
Problem
Context::ensureMinimalUserStandaloneBodies() still eagerly NestedJIT/links LastErrorRuntime on every thin AOT user-script init (hello-world / aot-smoke path), even when the script never calls error_get_last / error_clear_last:
LastErrorRuntime::ensureStandaloneBodies → NestedJIT ErrorLastJitHelper + __phpc_last_error_* bridges (ends with clearInsertionPosition())
Same always-on NestedJIT vs Runtime ABI drift / cold-build surface class as closed #34621 / #34612 / #34605 / #32122 .1-mint risk.
Call sites already ensure before use:
ext/standard/JitErrorGetLast.php — invoke / clear → LastErrorRuntime::ensureLinked
ext/standard/JitTriggerErrorKernel.php — implement → LastErrorRuntime::ensureLinked (also covers thin init when StringTriggerError stays always-on)
LastErrorRuntime::implement must capture/restore builder insert (peer JitHelperAbiBridge / #34621) so mid-{main} ensureLinked is safe — today it always clearInsertionPosition().
php-src reference
PHP implementation target
lib/JIT/Builtin/LastErrorRuntime.php — capture/restore insert around implement (do not always clear)
lib/JIT/Context.php — remove LastErrorRuntime::ensureStandaloneBodies from ensureMinimalUserStandaloneBodies(); keep htmlspecialchars / echo / trigger_error / argv / env essentials
- Full standalone still
ensureStandaloneBodies in ensureFullStandaloneBodies
Repro
./script/docker-exec.sh -- bash -lc 'script/cold-build-check.sh'
./script/aot-smoke.sh
Done when
Parent
Category
Foundation· php-in-php · runtime-shrink · cold-build / #32122 classProblem
Context::ensureMinimalUserStandaloneBodies()still eagerly NestedJIT/linksLastErrorRuntimeon every thin AOT user-script init (hello-world / aot-smoke path), even when the script never callserror_get_last/error_clear_last:LastErrorRuntime::ensureStandaloneBodies→ NestedJITErrorLastJitHelper+__phpc_last_error_*bridges (ends withclearInsertionPosition())Same always-on NestedJIT vs Runtime ABI drift / cold-build surface class as closed
#34621/#34612/#34605/#32122.1-mint risk.Call sites already ensure before use:
ext/standard/JitErrorGetLast.php—invoke/clear→LastErrorRuntime::ensureLinkedext/standard/JitTriggerErrorKernel.php—implement→LastErrorRuntime::ensureLinked(also covers thin init whenStringTriggerErrorstays always-on)LastErrorRuntime::implementmust capture/restore builder insert (peerJitHelperAbiBridge/#34621) so mid-{main}ensureLinkedis safe — today it alwaysclearInsertionPosition().php-src reference
ext/standard/basic_functions.c—error_get_last/error_clear_lastPHP implementation target
lib/JIT/Builtin/LastErrorRuntime.php— capture/restore insert around implement (do not always clear)lib/JIT/Context.php— removeLastErrorRuntime::ensureStandaloneBodiesfromensureMinimalUserStandaloneBodies(); keep htmlspecialchars / echo / trigger_error / argv / env essentialsensureStandaloneBodiesinensureFullStandaloneBodiesRepro
./script/docker-exec.sh -- bash -lc 'script/cold-build-check.sh' ./script/aot-smoke.shDone when
ensureMinimalUserStandaloneBodiesdoes not callLastErrorRuntime::ensureStandaloneBodiesLastErrorRuntime::implementrestores builder insert (peer php-in-php: drop Context ensureMinimalUserStandaloneBodies always-on JitReturnPending — lazy at try/finally (peer #34612) #34621)./script/aot-smoke.shstays 8/8script/cold-build-check.shokerror_get_last/trigger_errorstill match Zendruntime/*.cParent