We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hello,
It looks like the scope of loop variable to not clearly detected
https://phpstan.org/r/5cf62680-7651-4d08-bc82-69be0fe581aa
<?php declare(strict_types = 1); function explain(int $bitField): void { for ($i = 0; $i < 5; ++$i) { } for (; $i < 15; ++$i) { } }
no error :)
maybe related to
The text was updated successfully, but these errors were encountered:
@lyrixx After the latest commit in dev-master, PHPStan now reports different result with your code snippet:
@@ @@ -8: Comparison operation "<" between int<min, 8> and 15 is always true. +8: Comparison operation "<" between int<0, 8> and 15 is always true.
Comparison operation "<" between int<0, 8> and 15 is always true.
Sorry, something went wrong.
@@ @@ -8: Comparison operation "<" between int<min, 8> and 15 is always true. +No errors
phpstan/phpstan-src@ebfe7cf
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.
No branches or pull requests
Bug report
Hello,
It looks like the scope of loop variable to not clearly detected
Code snippet that reproduces the problem
https://phpstan.org/r/5cf62680-7651-4d08-bc82-69be0fe581aa
Expected output
no error :)
maybe related to
The text was updated successfully, but these errors were encountered: