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
With strict rules turned on PHPStan reports that a variable will always be overwritten if followed by a for loop that uses it in the assignment part, and that's great: https://phpstan.org/r/244ed1d0-003c-492f-99d2-ce5a075ae515
for
If you attempt to fix that though, you run into a contradictory error:
https://phpstan.org/r/030872ba-acba-4a27-b267-1f30156b1417
No errors
Yes, it helps me make it easier to spot errors in data providers
The text was updated successfully, but these errors were encountered:
This is expected. Strict rules disallow use of variables from loops outside loops. You can turn off this behaviour (enabled by strict rules) by this config option https://phpstan.org/config-reference#pollutescopewithloopinitialassignments to false true (edited)
Sorry, something went wrong.
Thanks @MartinMystikJonas !
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
With strict rules turned on PHPStan reports that a variable will always be overwritten if followed by a
for
loop that uses it in the assignment part, and that's great: https://phpstan.org/r/244ed1d0-003c-492f-99d2-ce5a075ae515If you attempt to fix that though, you run into a contradictory error:
Code snippet that reproduces the problem
https://phpstan.org/r/030872ba-acba-4a27-b267-1f30156b1417
Expected output
No errors
Did PHPStan help you today? Did it make you happy in any way?
Yes, it helps me make it easier to spot errors in data providers
The text was updated successfully, but these errors were encountered: