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
False positive: Unreachable statement #2835
Comments
This bug report is missing a link to reproduction on phpstan.org. |
Here's a condensed example: https://phpstan.org/r/c65b52e1-1859-4073-9705-d838cadf59f8 |
It is actually
but same result. |
Root issue is on line 14: https://phpstan.org/r/3bdee2b1-cfe9-44a0-8471-f41056cf851a |
Well, the condensed example is not quite correct. It uses a too simplified array. |
@ondrejmirtes sorry I don’t understand what you’re talking about |
Or rather, @dereuromark I think the example does reproduce the issue (and @ondrejmirtes was just pointing out where the bug takes effect) |
https://phpstan.org/r/dc254b38-d3c7-4ee1-8ab0-1a5969250e36 contains the full part of the above code without the int comparison side effect. |
|
@dereuromark no, PHPstan is definitely wrong - you're incrementing |
Assigning from |
This was (potentially) fixed by phpstan/phpstan-src#96 |
It wasn’t, though? I think the playground is synced automatically and the code still fails |
Nope, I actually looked at this bug whilst implementing that fix. My change fixes this code to work if you change it to use |
The problem was that when the Fixed by adding |
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
phpstan 0.12 latest
Code snippet that reproduces the problem
Expected output
This is not true.
The text was updated successfully, but these errors were encountered: