Closed nikcani closed 3 years ago
I don't have time right now to upgrade the library, but PRs are always welcome.
So I haven't gone too deeply into it but this seems to work fine under PHP 8 (built a parse tree running 8.0.3, no errors or warnings). Perhaps the composer.json could be updated to require "php": ">=7.2"
? That is until PHP 8 specific language features are added. @nikcani adding --ignore-platform-reqs
seems to do the trick for now.
@mtouellette, if you can look more in-depth to ensure nothing breaks in PHP 8, feel free to open a PR relaxing the version constraint in the composer file.
adding
--ignore-platform-reqs
seems to do the trick for now.
That is what I was using too 👍
I tried it too with php 8.0 with no errors or strange behaviors. Also, https://github.com/PHPCompatibility/PHPCompatibility does not produce any errors or warnings for versions 7.4-8.1
:~/work/antlr-php-runtime$ ./vendor/bin/phpcs -p src --standard=PHPCompatibility --runtime-set testVersion 7.4-8.1
............................................................ 60 / 130 (46%)
............................................................ 120 / 130 (92%)
.......... 130 / 130 (100%)
Time: 4.17 secs; Memory: 22MB
Thank you for checking. Could you please open a PR making the composer file to compatible with both PHP 7 and 8?
here it is: https://github.com/antlr/antlr-php-runtime/pull/14
some dependencies in "require-dev" don't support PHP 8 (and also actually produce errors), but those aren't needed to use the runtime... So it's enough to install this package with a --no-dev
flag for composer; like:
composer require antlr/antlr-php-runtime --no-dev
The about text here at github is "PHP 7 Runtime for ANTLR4". I would suggest to update this to "PHP 7/8 Runtime for ANTLR4".
Done! Thank you!
antlr/antlr4-php-runtime 0.4 requires php ^7.2 -> your php version (8.0.0) does not satisfy that requirement
Is PHP 8 support planned?