Conversation
dantleech
added a commit
that referenced
this pull request
Sep 28, 2025
- remove the "frame version" cache busting concept. - change the way the if statement resolver works.
298062f to
7c36076
Compare
dantleech
added a commit
that referenced
this pull request
Sep 28, 2025
- remove the "frame version" cache busting concept. - change the way the if statement resolver works.
7c36076 to
12b4df9
Compare
dantleech
added a commit
that referenced
this pull request
Sep 28, 2025
- remove the "frame version" cache busting concept. - change the way the if statement resolver works.
12b4df9 to
e347b05
Compare
- remove the "frame version" cache busting concept. - change the way the if statement resolver works.
e347b05 to
5caa7a9
Compare
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.
This PR removes the concept of "frame version" which was used to bust the cache whenever a variable was set. "Busting" the cache should never have been necessary in the first place due to the way that we should be traversing the AST.
Performance vs. Correctness
The way this has been done is potentially less accurate than the original solution but I'm confident the original solution was far from being correct.
In in some cases the static analysis is now twice as fast and uses less memory, for example, resolving diagnostics in a highly complex file :
Before:
After:
(note that PHPStan also takes around 30 seconds on this file)
Next Step
One issue seems to be the way that type assertions are applied with regards to conditional branches. Instead of searching the frame for variables before and after the if statement branches we could treat conditional branches as frames which inherit the variables of the parent. Frames can then have exit assertions which get applied automatically when leaving the frame.