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
PHPStan hangs on analysing small function #3686
Comments
This bug report is missing a link to reproduction on phpstan.org. |
I am unable to see how to save a link to the demo / test page. When I copy and paste the above code into the page, I get this error: An error occured. Please try again later. |
Can confirm this behaviour, will look into it. |
Here's a properly-typed version that should pass: <?php
/**
* @param int[][] $a
*/
function replaceStringWithZero(array $a) : string {
$keys = 'agfsdafsafdrew1231414';
foreach ($a as $b) {
foreach ($b as $c) {
if (isset($keys[$c])) {
$keys[$c] = "0";
}
}
}
return $keys;
} |
Fixed: phpstan/phpstan-src@6d81881 |
Thank you! |
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
On PHPStan 0.12.33 under Windows 10, PHP 7.4.6.
PHPStan hangs on processing this file (chopped down from working code, this code does not make sense):
Code snippet that reproduces the problem
Expected output
PHPStan finishes, probably with some errors, but it never returns.
It is the first and only file processed. Level 1. If you change just about anything, it does not hang. This is the smallest snippet of code I could make hang. It was hanging on old production code, so pretty sure the code is valid PHP and works correctly with no errors or warnings reported.
The text was updated successfully, but these errors were encountered: