Category
php-in-php · runtime-shrink (#1492 , peer #31606 / #31682 / #31655 )
Problem
Always-on LibcExtern still registers libc printf(3) even though:
User-script printf() already routes through PHP (JitPrintf / __compiler_printf / printf_ — Stdlib: printf() — formatted output to stdout (ext/standard/formatted_print.c parity) #3681 ).
The only NestedJIT lookupFunction('printf') consumers are four internal emitters that can declare printf module-locally.
Symbol
NestedJIT lookupFunction consumers
Target
printf
JitHeader, JitSetcookie, JitSessionStorageKernel (Set-Cookie), ScriptExit::echoString
module-local ensureLibcPrintf
Path
Today
Target
User-script printf()
JitPrintf / __compiler_printf
unchanged
LibcExtern
always-on printf
drop row
NestedJIT header/cookie/echo
rely on always-on
ensureLibcPrintf then lookup
php-src reference
PHP implementation target
ext/standard/JitHeader.php, JitSetcookie.php, JitSessionStorageKernel.php — module-local ensure
lib/JIT/Builtin/ScriptExit.php — module-local ensure
lib/JIT/LibcExtern.php — drop always-on 'printf' row
test/unit/LibcExternDeadDeclsRuntimeShrinkTest.php (+ targeted shrink guards)
Repro / verify
./script/phpunit.sh --filter ' LibcExternDeadDeclsRuntimeShrinkTest|LibcNameCollisionRuntimeShrinkTest'
./script/docker-exec.sh -- bash -lc ' php bin/vm.php -r "printf(\"%s\\n\", \"ok\");"'
./script/docker-exec.sh -- bash -lc ' php bin/jit.php -r "printf(\"%s\\n\", \"ok\");"'
Done when
Note
#10533 comments are locked (2500+); candidate recorded here instead of a tracker comment.
Category
php-in-php· runtime-shrink (#1492, peer #31606 / #31682 / #31655)Problem
Always-on
LibcExternstill registers libcprintf(3)even though:printf()already routes through PHP (JitPrintf/__compiler_printf/printf_— Stdlib: printf() — formatted output to stdout (ext/standard/formatted_print.c parity) #3681).lookupFunction('printf')consumers are four internal emitters that can declareprintfmodule-locally.lookupFunctionconsumersprintfJitHeader,JitSetcookie,JitSessionStorageKernel(Set-Cookie),ScriptExit::echoStringensureLibcPrintfprintf()JitPrintf/__compiler_printfLibcExternprintfensureLibcPrintfthen lookupphp-src reference
ext/standard/formatted_print.c—PHP_FUNCTION(printf)(user-script semantics stay in PHP)printfonly as a thin stdout format trampoline (not userprintf())PHP implementation target
ext/standard/JitHeader.php,JitSetcookie.php,JitSessionStorageKernel.php— module-local ensurelib/JIT/Builtin/ScriptExit.php— module-local ensurelib/JIT/LibcExtern.php— drop always-on'printf'rowtest/unit/LibcExternDeadDeclsRuntimeShrinkTest.php(+ targeted shrink guards)Repro / verify
Done when
LibcExternhas no'printf' =>rowprintfmodule-locally before lookupprintf()still matches Zend via VM/JITlib/AOT/runtime/*.cNote
#10533 comments are locked (2500+); candidate recorded here instead of a tracker comment.