Skip to content

Stdlib: bzopen()/bzread()/bzwrite()/bzclose() stream API missing — bzcompress() only (re-#3402, ext/bz2/bz2.c) #17301

Description

@PurHur

Category

stdlib · php-src-strict · partial ext/bz2 parity

Problem

ext/bz2 pure-PHP bzcompress()/bzdecompress() register on PHP_COMPILER_PROFILE=8.4, but the stream-oriented API (bzopen, bzread, bzwrite, bzclose) is absent. Zend exposes the full set when ext/bz2 is loaded. Issue #3402 closed without stream helpers.

Repro Zend 8.4 VM 8.4 profile (2026-07-07)
function_exists('bzopen') true false
function_exists('bzcompress') true true
bzopen($tmp,'w') round-trip resource + write/read undefined function

php-src reference

PHP implementation target

  • ext/bz2/ — stream resource type + bzopen/bzread/bzwrite/bzclose in PHP atop existing VmBz2Core compression primitives (PHP-in-PHP; no new C runtime logic)
  • ext/bz2/Module.php — register with CompilerVersion::supportsBz2() gate
  • lib/JIT/Builtin/ — optional phase-2 lowering after VM green

Repro

./script/docker-exec.sh -- bash -lc 'PHP_COMPILER_PROFILE=8.4 php bin/vm.php test/repro/maintainer_gap_bzopen_stream_api_84.php'
# Zend 8.4: ok · VM: fail: stream API missing on forward profile

Done when

  • bzopen/bzread/bzwrite/bzclose callable on VM when PHP_COMPILER_PROFILE=8.4 and extension_loaded('bz2')
  • Round-trip write/read repro green; JIT/AOT matrix updated when applicable
  • Compliance .phpt guard under test/compliance/cases/stdlib/ or ext/bz2
  • php-src-strict; no php-compiler-strict shortcut

No activity

Activity on this issue will appear here.

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 machineenhancementNew 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