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
When using 2 for loops, PHPStan reports:
Comparison operation "<" between int<min, 13> and 40 is always true.
In the snippet, it works fine with $predefinedShops = 1, but starts bugging from $predefinedShops = 2
$predefinedShops = 1
$predefinedShops = 2
https://phpstan.org/r/2eda8bb9-48f7-4dbe-8a73-4bc32d9806d6
No errors
The text was updated successfully, but these errors were encountered:
$totalShops = 40; $predefinedShops = 10; for ($i = 0; $i < $predefinedShops; $i++) { echo "Do something $i...\n"; } // i now matches always $totalShops bug // ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ for (;$i < $totalShops; $i++) { echo "Do something else $i...\n"; }
Sorry, something went wrong.
@mehdibo After the latest commit in dev-master, PHPStan now reports different result with your code snippet:
@@ @@ -9: Comparison operation "<" between int<min, 13> and 40 is always true. +9: Comparison operation "<" between int<0, 13> and 40 is always true.
Comparison operation "<" between int<0, 13> and 40 is always true.
@@ @@ -9: Comparison operation "<" between int<min, 13> and 40 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
When using 2 for loops, PHPStan reports:
In the snippet, it works fine with
$predefinedShops = 1
,but starts bugging from
$predefinedShops = 2
Code snippet that reproduces the problem
https://phpstan.org/r/2eda8bb9-48f7-4dbe-8a73-4bc32d9806d6
Expected output
No errors
The text was updated successfully, but these errors were encountered: