Category
stdlib · php-src-strict · declare(strict_types=1) call-site edge
Problem
#19023 restored php-src null→'' coercion for zlib one-shots on the default profile when the caller is not strict. Callers compiled with declare(strict_types=1) must still get a call-edge TypeError before callee coercion — Zend does; this compiler still coerces and runs the builtin.
| Repro |
Zend 8.2+ |
VM (2026-07-15) |
declare(strict_types=1); gzencode(null); |
TypeError |
coerces → compressed payload |
same for gzdeflate(null), gzcompress(null) |
TypeError |
coerces |
Loose callers (no strict_types) should keep php-src coercion from #19023; this issue is only the strict call edge.
php-src reference
PHP implementation target
ext/standard/VmZlib.php / VmZlibCore.php — route $data through shared strict call-edge guard before coercion
lib/JIT/Builtin/ZlibRuntime.php (and helpers) — mirror VM strict edge for JIT/AOT
- No new C in
runtime/
Repro
./script/docker-exec.sh -- bash -lc 'php bin/vm.php test/repro/maintainer_gap_zlib_null_strict_types_edge.php'
# Zend: strict_edge_ok · VM: gzencode: fail expected TypeError (exit 1)
Done when
Category
stdlib· php-src-strict ·declare(strict_types=1)call-site edgeProblem
#19023 restored php-src null→
''coercion for zlib one-shots on the default profile when the caller is not strict. Callers compiled withdeclare(strict_types=1)must still get a call-edgeTypeErrorbefore callee coercion — Zend does; this compiler still coerces and runs the builtin.declare(strict_types=1); gzencode(null);TypeErrorgzdeflate(null),gzcompress(null)TypeErrorLoose callers (no strict_types) should keep php-src coercion from #19023; this issue is only the strict call edge.
php-src reference
ext/zlib/zlib.c—PHP_FUNCTION(gzencode)/gzdeflate/gzcompress+ZEND_CHECK_ARG_TYPEat call sitePHP implementation target
ext/standard/VmZlib.php/VmZlibCore.php— route$datathrough shared strict call-edge guard before coercionlib/JIT/Builtin/ZlibRuntime.php(and helpers) — mirror VM strict edge for JIT/AOTruntime/Repro
Done when
maintainer_gap_zlib_null_strict_types_edge.phpgreen on VM/JIT/AOTmaintainer_gap_zlib_null_default.phpstays green (no regression)test/compliance/cases/stdlib/zlib_strict_types_null.phpt