Category
stdlib · php-src-strict
Problem
Zend supports %F in sprintf() / printf() / vsprintf() as a float conversion alias (uppercase f — same semantics as %f in practice for normal values).
This compiler throws at format-parse time:
LogicException: sprintf() unsupported conversion specifier %F in this compiler build
which breaks real-world format strings and parity with php-src.
php-src reference
Repro
# Zend reference
php -r 'echo sprintf("%F\n", 1.2);'
# VM failure today
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh
php bin/vm.php -r "echo sprintf(\"%F\\n\", 1.2);" 2>&1
php bin/vm.php -r "echo vsprintf(\"%F\\n\", [1.2]);" 2>&1
'
Zend expected: 1.200000 (representative; verify INF/NAN/-0.0 against Zend)
VM today: fatal LogicException before formatting.
Scope (this repo)
| Path |
Role |
ext/standard/VmSprintf.php |
add %F branch (likely alias to %f path) |
ext/standard/sprintf.php, printf.php, vsprintf.php |
entry points |
lib/JIT/Builtin/StringFormatJit.php |
if JIT parses specifiers separately, add %F there too |
lib/JIT/Builtin/SscanfJit.php |
out of scope unless scanf gains F (not in php-src) |
PHP-in-PHP first — implement in ext/standard + JIT PHP helpers; no runtime/*.c.
Done when
Related
Category
stdlib· php-src-strictProblem
Zend supports
%Finsprintf()/printf()/vsprintf()as a float conversion alias (uppercasef— same semantics as%fin practice for normal values).This compiler throws at format-parse time:
which breaks real-world format strings and parity with php-src.
php-src reference
ext/standard/sprintf.c— format parserext/standard/formatted_print.c—php_sprintf_internal, specifier dispatch (Fhandled alongsidef)ext/standard/basic_functions.stub.php—sprintf,vsprintf,printfRepro
Zend expected:
1.200000(representative; verify INF/NAN/-0.0 against Zend)VM today: fatal
LogicExceptionbefore formatting.Scope (this repo)
ext/standard/VmSprintf.php%Fbranch (likely alias to%fpath)ext/standard/sprintf.php,printf.php,vsprintf.phplib/JIT/Builtin/StringFormatJit.php%Fthere toolib/JIT/Builtin/SscanfJit.phpF(not in php-src)PHP-in-PHP first — implement in
ext/standard+ JIT PHP helpers; noruntime/*.c.Done when
%Fworks on VM forsprintf/vsprintf/printfand matches Zend for: normal float,INF,NAN,-0.0ValueError: Unknown format specifierlike Zend (notLogicException)test/compliance/cases/stdlib/sprintf_F_specifier.phptgreenRelated
vsprintfarray literal) · Stdlib: sscanf() %* assignment-suppression conversion unsupported — ValueError (ext/standard/formatted_io.c) #9560 (sscanf%*) · Epic: Self-host critical path — compiler compiles itself (M3→M5) #1492