Category
Regression: · php-src-strict · zlib null int $level
Problem
gzcompress / gzencode / gzdeflate second argument $level is typed int (default -1). Passing null under non-strict typing must emit E_DEPRECATED and coerce (Zend still compresses). VM silently succeeds with no deprecation.
Closed #28730 / #19332 covered null payload (gzcompress(null)), not null $level.
| Repro |
Zend 8.2+ |
VM (2026-08-16) |
gzcompress('a', null) |
E_DEPRECATED (#2 int) + compressed string |
silent compressed string |
gzencode('a', null) |
same |
silent |
gzdeflate('a', null) |
same |
silent |
php-src reference
PHP implementation target
ext/zlib/ PHP builtins / JIT helpers — shared int null DEP+coerce (default -1) before encode
- No new
runtime/*.c
Repro
./script/docker-exec.sh -- bash -lc 'php test/repro/maintainer_gap_gz_null_level.php'
./script/docker-exec.sh -- bash -lc 'php bin/vm.php test/repro/maintainer_gap_gz_null_level.php'
Done when
Category
Regression:· php-src-strict · zlib null int$levelProblem
gzcompress/gzencode/gzdeflatesecond argument$levelis typedint(default-1). Passingnullunder non-strict typing must emitE_DEPRECATEDand coerce (Zend still compresses). VM silently succeeds with no deprecation.Closed #28730 / #19332 covered null payload (
gzcompress(null)), not null$level.gzcompress('a', null)E_DEPRECATED(#2 int) + compressed stringgzencode('a', null)gzdeflate('a', null)php-src reference
ext/zlib/zlib.c—PHP_FUNCTION(gzcompress|gzencode|gzdeflate)ext/zlib/zlib.stub.php—int $level = -1PHP implementation target
ext/zlib/PHP builtins / JIT helpers — shared int null DEP+coerce (default-1) before encoderuntime/*.cRepro
Done when
E_DEPRECATEDtext; result still compressesstrict_types=1:TypeErrorfor null$level