-
-
Notifications
You must be signed in to change notification settings - Fork 863
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
Internal error for redefined FILTER_* constants #10483
Comments
This bug report is missing a link to reproduction at phpstan.org/try. It will most likely be closed after manual review. |
This has nothing to do with the "plugins" name. Some code in that directory simply crashes PHPStan. You can figure out which file does it by running PHPStan with |
Thanks for the quick reply, I was able to find the code just as you said. In this case there are some filter constants that are redefinded with a different type, see https://phpstan.org/r/7f3666b1-2b89-4de3-9271-7023e25dbb53. Still wasn't able to reproduce the error in the sandbox, so I assume there might be something else in play on my machine. Closing this issue, as it is not reproducable |
Maybe it's not reproducible in the playground, but you might have some luck creating a small reproducing repository. Don't give up, I want PHPStan to be usable for you 😊 |
the example in https://phpstan.org/r/7f3666b1-2b89-4de3-9271-7023e25dbb53 does not run into internal errors on my machine. @dhaeckel would be great if you could provide a small repository which reproduces your problem |
@staabm We don't need a repository, it's obvious how to reproduce this. |
I have a wild guess. @dhaeckel has a php version which has ext-filter disabled. the example at https://phpstan.org/r/7f3666b1-2b89-4de3-9271-7023e25dbb53 shows that constants will be re-defined with wrong types, e.g. |
@staabm You need to find a constant that's used in the Filter extension that was introduced in a later version of PHP. Then on earlier version introduce the same constant via a bootstrap file but with a wrong type. Boom, the assumption is broken. |
Bug report
PHPStan Crashes, when a directory named plugins is configured in paths, seems to stem from the symfony console. Happens even when a path is given as cli arg. Following are a minimal neon file and the stracktrace.
phar:///vendor/phpstan/phpstan/phpstan.phar/src/Type/Php/FilterFunctionReturnTypeHelper.php(185)
Code snippet that reproduces the problem
No response
Expected output
No Internal Error
Did PHPStan help you today? Did it make you happy in any way?
No response
The text was updated successfully, but these errors were encountered: