Category
stdlib · php-src-strict · PHP_COMPILER_PROFILE=8.4 forward null guards
Problem
Closed #18599 / #18780 / #18190 required null→TypeError for core case/length builtins. Under PHP_COMPILER_PROFILE=8.4, master again coerces null → "" / 0 (2026-07-15). Sibling phonetic pair is green after #19251; this batch still coerces.
| Repro |
Zend 8.4 forward |
VM PROFILE=8.4 (2026-07-15) |
strlen(null) |
TypeError |
0 |
strtolower(null) / strtoupper(null) |
TypeError |
'' |
strrev(null) |
TypeError |
'' |
php-src reference
PHP implementation target
ext/standard/VmString.php — shared forward-profile null guard for case/length/rev batch
lib/JIT/Builtin/String* — VM/JIT/AOT agree
Repro
./script/docker-exec.sh -- bash -lc 'export PHP_COMPILER_PROFILE=8.4
php -r '"'"'file_put_contents("/tmp/sl.php", "<?php
foreach ([\"strlen\",\"strtolower\",\"strtoupper\",\"strrev\"] as \$f) {
try { var_export(\$f(null)); echo \" \$f:OK\\n\"; }
catch (Throwable \$e) { echo \"\$f: \".get_class(\$e).\"\\n\"; }
}
");'"'"'
php bin/vm.php /tmp/sl.php'
# expect: *: TypeError · actual: *:OK coerced
Done when
Category
stdlib· php-src-strict · PHP_COMPILER_PROFILE=8.4 forward null guardsProblem
Closed #18599 / #18780 / #18190 required null→
TypeErrorfor core case/length builtins. UnderPHP_COMPILER_PROFILE=8.4, master again coerces null →""/0(2026-07-15). Sibling phonetic pair is green after #19251; this batch still coerces.strlen(null)TypeError0strtolower(null)/strtoupper(null)TypeError''strrev(null)TypeError''php-src reference
ext/standard/string.c—PHP_FUNCTION(strlen)/strtolower/strtoupper/strrevZ_PARAM_STRPHP implementation target
ext/standard/VmString.php— shared forward-profile null guard for case/length/rev batchlib/JIT/Builtin/String*— VM/JIT/AOT agreeRepro
Done when
TypeErroron null underPHP_COMPILER_PROFILE=8.4(VM/JIT/AOT).phptundertest/compliance/cases/string/