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
[1.9.0] count()
return type is 1
in a loop where the value changes at each iteration
#8277
Comments
1
in a loop where the value changes at each iteration
1
in a loop where the value changes at each iterationcount()
return type is 1
in a loop where the value changes at each iteration
Do you remember if you upgraded straight from the latest 1.8 to 1.9? Just trying to figure out if one of my changes broke this 😅 |
You have the code sample - you can bisect it. |
I know.. just being lazy here from my phone. Will do that :) |
Upgraded from 1.8.10, so I missed 1.8.11. |
Ladies and gentleman, we have a winner! It is me and I won a bugfix :) The commit that broke this was phpstan/phpstan-src@67819b2 |
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
Just upgraded PHPStan from 1.8.10 to 1.9.0 (missed 1.8.11) and I get this new inspection in a
swindow()
function¹ :¹:
window([1, 2, 3], width: 2);
outputs[[1, 2], [2, 3]]
, only for streams instead of arraysCode snippet that reproduces the problem
https://phpstan.org/r/1b6492a8-0d46-4789-824a-7e899d2c90c4
Expected output
No error, the return type of count() should be
int<1, max>
in this case (we know the array as at least one value, nothing more).Did PHPStan help you today? Did it make you happy in any way?
Thanks a lot for all the hard work on this latest release!
The text was updated successfully, but these errors were encountered: