psx-sandbox icon indicating copy to clipboard operation
psx-sandbox copied to clipboard

Uncaught Error: Undefined constant PhpParser\ParserFactory::PREFER_PHP7

Open gilney-canaltelecom opened this issue 1 year ago • 2 comments

Hi, just a heads up that when i try to run this lib, i'm getting this error, even with the most simple example.

The nikic/php-parser 5.0+ package changed a lot, including the removal of this constant.

I "solved" the problem, for now, by adding this to my composer file: nikic/php-parser": "^4.0,.

gilney-canaltelecom avatar Sep 10 '24 13:09 gilney-canaltelecom

Hi @gilney-canaltelecom indeed, since we use vimeo/psalm as dev dependencies we never run our test cases with nikic/php-parse 5.0 since it is not yet supported, but I have just checked it and added some fixes for 5.0 compatibility, the latest version should work now with 5.0

chriskapp avatar Sep 10 '24 18:09 chriskapp

Hi @gilney-canaltelecom indeed, since we use vimeo/psalm as dev dependencies we never run our test cases with nikic/php-parse 5.0 since it is not yet supported, but I have just checked it and added some fixes for 5.0 compatibility, the latest version should work now with 5.0

Thanks! 👍

gilney-canaltelecom avatar Sep 10 '24 18:09 gilney-canaltelecom