Skip to content

Derive ArrayAccess and __set simulation throw points directly instead of walking synthetic calls - #6148

Merged
ondrejmirtes merged 1 commit into
2.2.xfrom
array-access-sim-throw-points
Jul 30, 2026
Merged

Derive ArrayAccess and __set simulation throw points directly instead of walking synthetic calls#6148
ondrejmirtes merged 1 commit into
2.2.xfrom
array-access-sim-throw-points

Conversation

@ondrejmirtes

Copy link
Copy Markdown
Member

Extracted from the resolve-type-rewrite-2 branch.

The five simulation sites (offsetGet in ArrayDimFetchHandler, offsetSet and __set in AssignHandler, offsetExists in IssetHandler, offsetUnset in NodeScopeResolver's unset() processing) built a synthetic MethodCall and ran it through processExprNode() with a NoopNodeCallback just to read the resulting throw points.

The new MethodThrowPointHelper::getThrowPointsForCallOnType() derives the throw point directly from the receiver type's method reflection — dynamic throw-type extensions still receive the fabricated call node as their payload, but nothing walks it. The __set simulation also stops re-walking the real receiver, whose throw points the main walk had already collected (they were merged twice).

Zero analysis-output churn: full test suite, make phpstan and make cs green.

🤖 Generated with Claude Code

https://claude.ai/code/session_01DaBZjgksga4c5s6Q9FniY7

… of walking synthetic calls

The offsetGet/offsetSet/offsetExists/offsetUnset and __set simulations
built a synthetic MethodCall and processed it through processExprNode()
with a NoopNodeCallback just to read the resulting throw points. The new
MethodThrowPointHelper::getThrowPointsForCallOnType() derives them
directly from the receiver type's method reflection; the fabricated node
is only the throw-point anchor and the payload dynamic throw-type
extensions receive - nothing processes it.

The __set simulation no longer re-walks the real receiver, whose throw
points the main walk already collected.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DaBZjgksga4c5s6Q9FniY7
@ondrejmirtes
ondrejmirtes merged commit ff5a28e into 2.2.x Jul 30, 2026
741 of 744 checks passed
@ondrejmirtes
ondrejmirtes deleted the array-access-sim-throw-points branch July 30, 2026 14:02
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.

1 participant