Category
Regression · php-src-strict · over-strict null reject (Pillar 4)
Problem
Under PHP_COMPILER_PROFILE=8.4, password_hash / gzencode / implode throw TypeError when a string operand is null. Zend 8.4.23 emits E_DEPRECATED and coerces (password_hash hashes '', gzencode encodes empty, implode(null, …) uses '' separator → 'ab').
Probed 2026-07-20 vs php:8.4-cli (8.4.23) and php bin/vm.php.
| Repro |
Zend 8.4.23 |
VM PROFILE=8.4 |
password_hash(null, PASSWORD_DEFAULT) |
E_DEPRECATED + $2y$… hash of '' |
TypeError ❌ |
gzencode(null) |
E_DEPRECATED + 20-byte gzip of empty |
TypeError ❌ |
implode(null, ['a','b']) |
E_DEPRECATED + 'ab' |
TypeError ❌ |
php-src reference
PHP implementation target
- Soften null reject under PROFILE=8.4 via shared string coerce+deprecation helpers in the PHP builtins + JIT lowering. PHP-in-PHP; no new C. VM/JIT/AOT agree. Distinct from open
#4162 (password_verify scalar coerce).
Repro
./script/docker-exec.sh -- bash -lc 'export PHP_COMPILER_PROFILE=8.4
php bin/vm.php -r "
set_error_handler(function (\$n, \$m) { echo \"DEP\\n\"; return true; });
\$cases = [
[\"password_hash\", [null, PASSWORD_DEFAULT]],
[\"gzencode\", [null]],
[\"implode\", [null, [\"a\", \"b\"]]],
];
foreach (\$cases as [\$f, \$a]) {
try { \$r = \$f(...\$a); echo \$f, \" OK\\n\"; }
catch (Throwable \$e) { echo \$f, \" \", get_class(\$e), PHP_EOL; }
}
"
# expect DEP + OK, not TypeError
'
Done when
Related
Category
Regression· php-src-strict · over-strict null reject (Pillar 4)Problem
Under
PHP_COMPILER_PROFILE=8.4,password_hash/gzencode/implodethrowTypeErrorwhen a string operand isnull. Zend 8.4.23 emitsE_DEPRECATEDand coerces (password_hashhashes'',gzencodeencodes empty,implode(null, …)uses''separator →'ab').Probed 2026-07-20 vs
php:8.4-cli(8.4.23) andphp bin/vm.php.password_hash(null, PASSWORD_DEFAULT)E_DEPRECATED+$2y$…hash of''TypeError❌gzencode(null)E_DEPRECATED+ 20-byte gzip of emptyTypeError❌implode(null, ['a','b'])E_DEPRECATED+'ab'TypeError❌php-src reference
ext/standard/password.c—PHP_FUNCTION(password_hash)ext/zlib/zlib.c—PHP_FUNCTION(gzencode)ext/standard/array.c—PHP_FUNCTION(implode)#21189, closed#20611PHP implementation target
#4162(password_verifyscalar coerce).Repro
Done when
Related
#21189#4162· closed#20611