Repository navigation
Conversation
Author
|
CI note: the The PHP 7.4 call syntax and Turbo version-pin failures from my first push have been corrected in the current head. |
This was referenced Oct 17, 2026
LubuSeb
force-pushed
the
codex/fix-class-token-symbol-scan
branch
from
October 18, 2026 12:56
5279933 to
bba1cf7
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.
When a global constant follows
stdClass::classinside a function, the directory symbol scan can mistake theclassname token for a declaration and lose the constant. The same can happen with identifiers beginning withclass. This change checks the keyword boundary before entering type scope in both the PHP cleaner and the Turbo scanner.The regression covers
::class,className(), and a real anonymous class. The native differential corpora also include the trigger. Thanks to @Victor-emil for identifying the cause and suggesting the boundary check in phpstan/phpstan#15482.Validation: the focused PHPUnit test passes (3 tests); the source-locator suite passes (78 tests, 159 assertions, 1 skip); and the issue's two-file example analyzes without errors using this branch. PHP syntax and
git diff --checkpass. I could not run the native differential scripts locally because the Turbo extension is not installed.Fixes phpstan/phpstan#15482