PHP-Parser icon indicating copy to clipboard operation
PHP-Parser copied to clipboard

README appears to be out of date

Open davidpcaldwell opened this issue 2 years ago • 2 comments

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.

davidpcaldwell avatar Sep 21 '22 18:09 davidpcaldwell

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.

nikic avatar Sep 21 '22 18:09 nikic

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.

davidpcaldwell avatar Sep 22 '22 02:09 davidpcaldwell

+1 to @davidpcaldwell, maybe makes sense to set the default branch to the latest major release?

pronskiy avatar Oct 30 '22 11:10 pronskiy

Good idea, done.

nikic avatar Oct 30 '22 13:10 nikic

Closing this, as I think the default branch switch should avoid any confusion.

nikic avatar Oct 31 '22 09:10 nikic