Repository navigation
Update nikic/PHP-Parser to 5.9.0 - #6498
Merged
Merged
Conversation
Regenerated the native parser engine's reduce actions for the new
argument-list grammar (ArgPlaceholder, "..." in any argument position)
and ported the tightened \u{...} escape limit (0x10FFFF) to the native
String_::parseEscapeSequences(). Corpus fixtures cover both.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017ZXwmsVRBa9PE9htEXAnwo
tests/parser-upstream-corpus.php parses every input php-parser's test suite parses (parser, pretty-printer and format-preservation cases) with both engines, fetching the installed commit from GitHub or taking a checkout. Upstream's cases cover every grammar rule, error recovery and version-gated behavior, including syntax PHPStan's own code does not use yet. The comparison moves to parser-compare.php, shared with parser-corpus.php. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017ZXwmsVRBa9PE9htEXAnwo
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.
Updates nikic/PHP-Parser from 5.8.0 to 5.9.0, together with the turbo-ext native parser engine.
turbo-ext
generate-parser-actions.php) for 5.9's new argument-list grammar:ArgPlaceholdernodes for?, and...allowed in any argument position. The generator needed no new hand-written overrides.ArgPlaceholderhas a trivial constructor, so it gets direct property writes.\u{...}escape limit (0x10FFFF, was0x1FFFFF) to the nativeparseEscapeSequences().ParserAbstract.phpdiff is doc comments only, and the new@hexdecinFloat_only silences a PHP 8.6 warning, which the native port never emits.SUPPORTED_PHP_PARSER_VERSIONis nowv5.9.0andEXPECTED_EXTENSION_VERSIONis0867753.turbo-ext/tests/parser-fixtures/for partial function application and both sides of the\u{10FFFF}limit.turbo-ext/tests/parser-upstream-corpus.php: runs the same native-vs-PHP comparison over every input php-parser's own test suite parses (parser, pretty-printer and format-preservation cases). It fetches the installed commit from GitHub, or takes a checkout path. CI runs it next toparser-corpus.php. The shared comparison moved toparser-compare.php.Verification (PHP 8.5, macOS arm64)
parser-corpus.php: 8,466 files, 0 differences.parser-upstream-corpus.php: 524 upstream cases, 0 differences.0x1FFFFFlimit, the new fixtures fail, and so does upstream'sunicodeEscape.test #3.make phpstanwith and without the extension: no errors in both.srcplus 5 vendored libraries is identical with and without the extension (3,739 lines). The only difference isPHPStanTurbo\Runtime, a class that only exists when the extension is loaded.smoke.php,signature-parity.phpandside-by-side.php --checkpass.parser-bench.php: native parsing 2.8× faster than PHP (0.354s vs 0.997s user).Known issue: partial function application
5.9 parses PHP 8.6 partial function application, e.g.
foo(?),foo(1, ...),new A(?),A::s(?). With 5.8 these were syntax errors. PHPStan now crashes with an internal error on each of these forms, with or without the extension. Examples:ArrayMapArgVisitorcallssetAttribute()on nullMutatingScope::getType()gets nullParametersAcceptorSelectorcallsgetAttribute()on nullArgumentsNormalizerbuilds anArgwith a null valueThis PR doesn't handle it. The follow-up is either reporting this syntax as unsupported or implementing support for it.
🤖 Generated with Claude Code
https://claude.ai/code/session_017ZXwmsVRBa9PE9htEXAnwo