AOT: TypeError on ++/-- of live fopen resources (#23777) - #23794
Merged
Conversation
Stale helper-cache NestedJIT left VmFs::fopen as an ExternalMethod null stub (handle 0), so ++$fh never saw a resource. Register php://memory|temp opens in a shared JitOpenStreamHandles table NestedJIT'd with StreamIo + StreamLifecycle, widen the ++/-- resource guard, and abort standalone AOT with Uncaught TypeError (exit 255) like Zend. Co-authored-by: Cursor <cursoragent@cursor.com>
This was referenced Jul 27, 2026
PurHur
added a commit
that referenced
this pull request
Jul 27, 2026
#23794 / #23797 added IncDecResourceProvenance to the spine but left ext/standard/JitOpenStreamHandles.php (php://memory fopen table for AOT ++/-- resource guards) off the bundle. spine-sync --no-link restores 6588/6588 coverage so release-readiness spine + north-star5-fast pass. Co-authored-by: PurHur <PurHur@users.noreply.github.com> Co-authored-by: Cursor <cursoragent@cursor.com>
This was referenced Jul 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
++$fhafterfopen('php://memory','r+')now raisesTypeError: Cannot increment resource(exit 255) instead of printingno error.StreamIoJitHelpertreatedVmFs::fopenas anExternalMethodnull stub ((int)null === 0), so there was no live resource forguardIncDecResourceOperand()to reject. The Language: increment/decrement on resource — TypeError parity (zend_operators.c) #6396 guard hole for some operand shapes is also covered.JitOpenStreamHandlesNestedJIT registry forphp://memory|tempopens, wired into StreamIo + StreamLifecycle helper bundles; broaden ++/-- resource guard; standalone AOT usesphpc_jit_abort_if_pending_type_error(Zend-like fatal + rc 255).php-src reference
Zend/zend_operators.c— increment/decrement on resources → TypeErrorTest plan
PHP Fatal error: Uncaught TypeError: Cannot increment resource,rc=255(wasno error/rc=0).script/differential-sweep.sh --dirwithg07_inc_resource.php— VM matches Zend./script/phpunit.sh --filter 'StreamIoRuntimeStandaloneTest|StreamLifecycleRuntimeStandaloneTest'— OK (3 tests)ci-local/north-star5-verify --strictMade with Cursor