Skip to content

chore: support PHP 8.4 and 8.5 in parallel (+ adapt to current z-engine hashtable API) - #14

Merged
lisachenko merged 2 commits into
mainfrom
claude/php-8.4-8.5-support-us9adi
Aug 7, 2026
Merged

chore: support PHP 8.4 and 8.5 in parallel (+ adapt to current z-engine hashtable API)#14
lisachenko merged 2 commits into
mainfrom
claude/php-8.4-8.5-support-us9adi

Conversation

@lisachenko

Copy link
Copy Markdown
Owner

What

Two commits:

1. fix: adapt to z-engine's owned-vs-borrowed hashtable construction

z-engine's a56d59d refactor removed PersistentHashTable::create() (now an owning zero-argument constructor) and HashTable's one-argument wrapping constructor + releaseReference(). main no longer installs cleanly against either current z-engine line — every test errored with Call to undefined method PersistentHashTable::create().

  • Persister/Registry: PersistentHashTable::create()new PersistentHashTable().
  • PersistentStore::detach(): the old (new HashTable($ptr))->releaseReference() call had become a silent leak — PHP ignores extra constructor arguments, so it allocated a fresh table and released that, leaking the rebuilt dynamic-properties table every attach/detach cycle (~340 B/cycle, caught by the flat-memory soak gate). Now mirrors zend_array_release(): decrement the refcount and hand the zero-refcount array to rc_dtor_func so the engine frees it through its own allocator.

2. chore: support PHP 8.4 and 8.5 in parallel

  • composer.json: php: ^8.4, lisachenko/z-engine: 8.4.x-dev || 8.5.x-dev (replaces dev-master || ^8.4). Verified: Composer resolves 8.4.x-dev on PHP 8.4 and dev-master (aliased 8.5.x-dev) on PHP 8.5.
  • CI: all four jobs (tests, both soaks, FastCGI request-boundary gate) now run a ['8.4', '8.5'] matrix.
  • README: PHP badge 8.4 | 8.5; requirements section replaces the stale note about the temporary claude/shared-objects-dag-memory-nq462w z-engine pin.

Validation (local, fresh installs per minor)

Gate PHP 8.4 PHP 8.5
vendor/bin/phpunit (39 tests) OK OK
tools/soak.php 5000 OK (−1.7 kB) OK
tools/soak-drop.php 5000 OK (3.75 kB/cycle, budget 6) OK
request-boundary not run locally (cgi-fcgi unavailable in sandbox) — CI covers it same

🤖 Generated with Claude Code

https://claude.ai/code/session_01Y5XNnAjcG8xSxun92V23Sm


Generated by Claude Code

claude added 2 commits August 7, 2026 21:57
z-engine removed PersistentHashTable::create() in favour of an owning
constructor, and HashTable's one-argument wrapping constructor along with
releaseReference(). The old wrapping call in detach() silently allocated a
fresh table (PHP ignores extra constructor arguments) and released that
instead of the rebuilt dynamic-properties table, leaking it on every
attach/detach cycle - the flat-memory soak gate caught the growth.
Release the table the way zend_array_release() does: drop the reference
and hand the zero-refcount array to rc_dtor_func so the engine dismantles
it through its own allocator.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y5XNnAjcG8xSxun92V23Sm
Widen php to ^8.4 and require z-engine as 8.4.x-dev || 8.5.x-dev so
Composer resolves the line matching the running minor. Run every CI job
- unit/lifecycle, both soaks and the FastCGI request-boundary gate - on
both minors, and refresh the badge and requirements docs.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y5XNnAjcG8xSxun92V23Sm
@lisachenko
lisachenko marked this pull request as ready for review August 7, 2026 22:48
@lisachenko
lisachenko merged commit 0726110 into main Aug 7, 2026
8 checks passed
@lisachenko
lisachenko deleted the claude/php-8.4-8.5-support-us9adi branch August 7, 2026 22:48
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.

2 participants