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
Version is 0.12.0
It appears that bounds for the derived variable $i has the bounds applied from the for loop variables.
$i
for
<?php declare(strict_types=1); class MyClass{ public $t = 0; public function test() : array{ $result = []; for($xx = 0; $xx <= 2; ++$xx){ for($zz = 0; $zz <= 2; ++$zz){ $i = $zz * 3 + $xx; if($i === 4){ continue; //center chunk } $result[$i] = true; } } return $result; } }
https://phpstan.org/r/a1836aad-4d1e-42df-ad12-f8772c4b2ffb
No errors (on level 4, at least).
The text was updated successfully, but these errors were encountered:
Seems like this is fixed in 0.12.3.
Sorry, something went wrong.
Please don’t close issues without proper regression tests.
phpstan/phpstan-src@a17cdaf
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
Version is 0.12.0
It appears that bounds for the derived variable
$i
has the bounds applied from thefor
loop variables.Code snippet that reproduces the problem
https://phpstan.org/r/a1836aad-4d1e-42df-ad12-f8772c4b2ffb
Expected output
No errors (on level 4, at least).
The text was updated successfully, but these errors were encountered: