New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Does not skip code guarded by PHP_VERSION_ID resulting in "Internal error: syntax error" #6386
Comments
This bug report is missing a link to reproduction on phpstan.org. It will most likely be closed after manual review. |
Hi, can you please create a small reproducing repository that shows this problem? Thanks. |
-> https://github.com/lazka/phpstan-api-platform-php8-syntax-issue I hope this is small enough. |
Thank you, perfect. I'm gonna look into it in the next few days. |
Fixed: phpstan/phpstan-src@433511a Regression test: a1217f8 |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Bug report
I'm using api-platform and they have recently started to include php8 only files and guard their uses via
PHP_VERSION_ID
checks. For example:https://github.com/api-platform/core/blob/4ec515837cf696788e828a61005594fffc4cf244/src/Util/ClientTrait.php#L16
which then conditionally includes:
https://github.com/api-platform/core/blob/4ec515837cf696788e828a61005594fffc4cf244/src/Util/ClientTrait80.php#L18
which is PHP8 only syntax, and fails with PHP 7.4.
Related downstream issue: api-platform/core#4614
Code snippet that reproduces the problem
Expected output
No output
Did PHPStan help you today? Did it make you happy in any way?
every day :)
The text was updated successfully, but these errors were encountered: