-
Notifications
You must be signed in to change notification settings - Fork 523
Fix infinite loop when fully qualified callback is supplied #2005
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
Conversation
is the endless loop scenario reproducible in a AnalyzerIntegrationTest? |
af6c1bc
to
d165186
Compare
I've added a test case which curiously causes a segfault when run as part of the test suite matching: phpstan/phpstan#8290 |
The build failures (once I found them) don't appear to be related. |
This seemed to only cause a problem when running the code on PHP 7 and where the same file contained a native call to the same callback function. Example: <?php \array_filter([1], '\\is_int'); \is_int(1);
d165186
to
f17624a
Compare
Anything else needed to get this merged please? |
Ondrey has problems with his computer and waits to get it repaired. Please be patient. |
I need to try out locally the test fails when the fix is reverted. |
I haven't got the test to fail locally instead PHP segfaults, not ideal, but it's not a pass! You need to run the code through Rector to downgrade it to PHP 7.2 to cause the failure, no idea why it works fine on PHP 8. 😕 |
I can reproduce the problem if I downgrade the code to 7.4 and run it on PHP 7.4. This is the stack trace:
|
Thank you! |
Fixes phpstan/phpstan#8376
This seemed to only cause a problem when running the code on PHP 7 and where the same file contained a native call to the same callback function.
Example:
You can replicate the problem by running Rector over the code and then trying to analyse a file containing the above example using PHP 7.4.