You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Strict Rules: Foreach overwrites $queryString with its value variable. #9940
It might be hard to work around this one. Thanks to "conditional type expressions" in Scope PHPStan knows that $queryString for sure exists when $queryStrings is not empty.
But with polluteScopeWithAlwaysIterableForeach: false it shouldn't use this deduction.
Activity
staabm commentedon Sep 29, 2023
especially interessting is, that when we drop the "return block" its all green
https://phpstan.org/r/947bf039-baba-40c3-9cb9-bb8b9e3715c9
ondrejmirtes commentedon Sep 29, 2023
It might be hard to work around this one. Thanks to "conditional type expressions" in Scope PHPStan knows that
$queryStringfor sure exists when$queryStringsis not empty.But with
polluteScopeWithAlwaysIterableForeach: falseit shouldn't use this deduction.lulco commentedon Oct 23, 2023
Related phpstan/phpstan-strict-rules#194
github-actions commentedon Oct 13, 2026
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.