Skip to content

Bump nikic/php-parser versions#43

Merged
szepeviktor merged 1 commit intophp-stubs:masterfrom
IanDelMar:parser-version
Feb 10, 2026
Merged

Bump nikic/php-parser versions#43
szepeviktor merged 1 commit intophp-stubs:masterfrom
IanDelMar:parser-version

Conversation

@IanDelMar
Copy link
Contributor

This PR updates the minimum supported versions of nikic/php-parser for both the v4 and v5 dependency lines.

Version 4: bump from 4.10 to 4.18

PR #33 added support for PHP 7.4+ by replacing the call to PhpParser\ParserFactory::create() with PhpParser\ParserFactory::createForNewestSupportedVersion(). createForNewestSupportedVersion() is only available starting with nikic/php-parser 4.18, and the minimum required v4 version was not updated accordingly.

Bumping the minimum v4 version to 4.18 removes the risk of calling an undefined method.

Version 5: bump from 5.1 to 5.5

Starting with nikic/php-parser 5.5.0, attribute printing was fixed to work correctly on PHP versions < 8.0 (also see the related issue: nikic/PHP-Parser#1081). The minimum required v5 version has not been updated since.

Bumping the minimum v5 version to 5.5 removes the risk of generating stubs that might cause parse errors when running on PHP < 8.0.

For discussion

The attribute-printing fix was not backported to the v4 line. If it is intended to keep supporting nikic/php-parser v4, it may be better to explicitly document that attribute printing on PHP < 8.0 remains unfixed there. Alternatively, support for v4 could be dropped.

@IanDelMar
Copy link
Contributor Author

@szepeviktor Have you seen this PR yet? If you have concerns or would prefer changes, I’m happy to discuss.

@szepeviktor szepeviktor merged commit 656358a into php-stubs:master Feb 10, 2026
9 checks passed
@IanDelMar IanDelMar deleted the parser-version branch February 11, 2026 10:25
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.

2 participants

Comments