Skip to content

Regression: gzcompress/gzdeflate/gzencode(null) still coerce under PROFILE=8.4 — Zend TypeError (re-#19332, ext/zlib) #28730

Description

@PurHur

Category

Stdlib · php-src-strict · PROFILE≥8.4 · re-#19332 / #19112 / #21210 · sibling of #28689

Problem

Under PHP_COMPILER_PROFILE=8.4, zlib compressors still coerce null $data (Deprecated + empty-payload compressed bytes) instead of TypeError per Zend 8.4 stubs (string $data). Prior closed issues have regressed.

Verified 2026-08-07 on master @8232de4a23 (VM). Host reference is 8.2; done-when is php-src 8.4 TypeError.

Call Zend 8.4+ VM PROFILE=8.4 (2026-08-07)
gzcompress(null) TypeError Deprecated + zlib empty payload (789c030000000001)
gzdeflate(null) TypeError Deprecated + empty deflate (0300)
gzencode(null) TypeError Deprecated + gzip empty payload

php-src reference

PHP implementation target

  • PROFILE≥8.4 null→TypeError via shared string-arg guards in ext/zlib (e.g. VmZlib) + VM/JIT — not new C in runtime/

Repro

./script/docker-exec.sh -- bash -lc 'PHP_COMPILER_PROFILE=8.4 php bin/vm.php /tmp/zlib_null84.php'
<?php
error_reporting(E_ALL);
foreach (['gzcompress','gzdeflate','gzencode'] as $f) {
    try {
        $r = $f(null);
        echo "$f => ";
        var_export(bin2hex($r));
        echo "\n";
    } catch (Throwable $e) {
        echo "$f EX ", get_class($e), ':', $e->getMessage(), "\n";
    }
}

Done when

  • Under PROFILE≥8.4 listed zlib APIs throw TypeError on null (VM + JIT; AOT if in scope)
  • ≤8.3 profile keeps Zend deprecate+coerce
  • Compliance .phpt under test/compliance/cases/stdlib/ (or zlib/)
  • 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