Repository navigation
[perf] Skip call reflection when no closure/arrow/array arg - #8711
Merged
TomasVotruba merged 1 commit intoOct 19, 2026
Merged
Conversation
…keReflectionNodeVisitor
TomasVotruba
deleted the
skip-call-reflection-without-closure-array-arg
branch
October 19, 2026 09:21
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.
CallLikeReflectionNodeVisitordecorates call arguments and runs on everyCallLikenode during metadata decoration. It resolved the function-like reflection for every call that has arguments - but that reflection is only used to decorate aClosure/arrow-fn arg passed to a variadic callable param, or an array arg passed to a param that cannot hold a Closure. A call likestrlen($s)or$this->foo($x, $y)- the overwhelming majority - paid for the resolve and decorated nothing.A cheap node-only pre-check (
hasClosureArrowOrArrayArg) now bails beforeresolveFunctionLikeReflectionFromCall()when no argument is aClosure,ArrowFunction, orArray_. Both decoration helpers already no-op without such an arg, so the behavior is unchanged.Full test suite passes (4988 tests).
Bench included (
bench/call_like_reflection_visitor_bench.php), drivingenterNode()over 240 ordinary calls. CPU per call, two runs each:~6-7x faster on that path, and it is on the hot decoration traversal that visits every call in every file.