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
i have a foreach loop with a variablename $p and within a closure with the same variablename and type. phpstan seem to access wrong scope here for analysis. it should honor the scope of the closure. i know this can and should be resolved with better names, but i was confused about the error reported and think there might be some other issues burried under this false positive.
Did PHPStan help you today? Did it make you happy in any way?
yes, because we successfully introduced phpstan in our huge legacy codebase at work to keep improving our sourcecode! 🎉 thank you so much for this project!
The text was updated successfully, but these errors were encountered:
Bug report
phpstan 1.4.2
i have a foreach loop with a variablename
$p
and within a closure with the same variablename and type. phpstan seem to access wrong scope here for analysis. it should honor the scope of the closure. i know this can and should be resolved with better names, but i was confused about the error reported and think there might be some other issues burried under this false positive.Code snippet that reproduces the problem
https://phpstan.org/r/c736dc1c-3df9-414d-8a58-8189d13af840
Expected output
no complaints, as in this snipped: https://phpstan.org/r/69eb5d37-c8e1-42d4-b044-93121bf79d8b
Did PHPStan help you today? Did it make you happy in any way?
yes, because we successfully introduced phpstan in our huge legacy codebase at work to keep improving our sourcecode! 🎉 thank you so much for this project!
The text was updated successfully, but these errors were encountered: