apioo / psx-sandbox

Execute PHP code in a sandbox
Apache License 2.0
17 stars 4 forks source link

Uncaught Error: Undefined constant PhpParser\ParserFactory::PREFER_PHP7 #5

Open gilney-canaltelecom opened 1 month ago

gilney-canaltelecom commented 1 month ago

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,.

chriskapp commented 1 month ago

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

gilney-canaltelecom commented 1 month ago

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! 👍