Skip to content

php-in-php: VmGzStreamPure — drop libz gzFile FFI from gz* streams (#8936) - #12049

Merged
PurHur merged 1 commit into
masterfrom
agent/issue-8936-gz-stream-php
Jun 26, 2026
Merged

PurHur merged 1 commit into
masterfrom
agent/issue-8936-gz-stream-php

Conversation

@PurHur

@PurHur PurHur commented Jun 26, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add ext/standard/VmGzStreamPure.php — buffered plaintext read/write with VmZlib::gzencode/gzdecode on open/close
  • Shrink VmGzStreamNative.php to a thin delegate (removed ~158 lines of libz gzFile FFI)
  • php-src ref: ext/zlib/zlib.c (php_gzopen, stream ops)

Closes #8936

Runtime shrink

File Before After
VmGzStreamNative.php ~202 lines (libz FFI) ~44 lines (delegate)

FFI symbols removed: gzFile, gzopen, gzwrite, gzread, gzclose from VmGzStreamNative.

Verification

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh
vendor/bin/phpunit --filter VmGzStreamRuntimeShrinkTest
php bin/vm.php test/repro-maintainer/gz_stream_php_in_php_probe.php
'
PHPUnit 9.6.21 by Sebastian Bergmann and contributors.

...line1
line2
line1
line2
..                                                               5 / 5 (100%)

OK (5 tests, 26 assertions)
hello
make bootstrap-selfhost-vm-driver-execute-probe
php script/bootstrap-inventory.php --check
php script/check-selfhost-spine-coverage-sync.php

All green.

Note

Compression still routes through VmZlibNative libz FFI until #8837 lands pure-PHP deflate; this PR removes the separate gzFile stream FFI layer per issue scope.

Made with Cursor

…8936)

Route gzopen/gzwrite/gzread/gzclose through buffered plaintext plus VmZlib
encode/decode instead of libz gzFile FFI in VmGzStreamNative.

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur
PurHur merged commit ca4a6c1 into master Jun 26, 2026
@PurHur
PurHur deleted the agent/issue-8936-gz-stream-php branch June 26, 2026 09:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

php-in-php: VmGzStreamNative — pure PHP gz* stream I/O without libz FFI (#1492, ext/zlib/zlib.c)

1 participant