Skip to content

Regression: gzencode/gzdeflate/gzcompress(null) — declare(strict_types=1) call edge ignored (re-#19023, ext/zlib/zlib.c) #19112

Description

@PurHur

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

  • maintainer_gap_zlib_null_strict_types_edge.php green on VM/JIT/AOT
  • Loose-profile repro maintainer_gap_zlib_null_default.php stays green (no regression)
  • Compliance guard under test/compliance/cases/stdlib/zlib_strict_types_null.phpt
  • 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 workingenhancementNew feature or requestimplementation-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