Skip to content

Regression: gzcompress/gzencode/gzdeflate(..., null) level silent — Zend E_DEPRECATED (ext/zlib/zlib.c) #31445

Description

@PurHur

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

  • All three: Zend-identical E_DEPRECATED text; result still compresses
  • strict_types=1: TypeError for null $level
  • Targeted compliance/PHPUnit guard
  • php-src-strict; no php-compiler-strict shortcut

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:vmVirtual machinebugSomething isn't workingimplementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claimphase-4:stdlibPhase 4 – stdlib for web appsstdlib

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions