PHP-Parser
PHP-Parser copied to clipboard
README appears to be out of date
When attempting to follow the instructions, by installing using composer require
and then running the example script that dumps the AST of an inlined set of PHP code, I was not able to use this line:
$parser = (new ParserFactory())->createForNewestSupportedVersion();
Instead, I used:
$parser = (new ParserFactory())->create(ParserFactory::ONLY_PHP7);
... which worked.
This is the README of the master branch for the next major version. You can browse https://github.com/nikic/PHP-Parser/tree/4.x for the stable 4.x release.
Makes sense -- it's a bit confusing, given that it's explicitly giving instructions to use composer require
and then the version that is produced is not compatible with the rest of the README.
But I have what I need, thanks! Probably I'd consider changing the (highly visible) README to make sense in terms of the current major version.
+1 to @davidpcaldwell, maybe makes sense to set the default branch to the latest major release?
Good idea, done.
Closing this, as I think the default branch switch should avoid any confusion.