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
Array value type is not narrowed when value itself is checked #7508
Activity
ondrejmirtes commentedon Jun 22, 2022
This is a bit far-fetched to expect PHPStan to understand this, you can simply rewrite your code as following:
phpstan-bot commentedon Sep 11, 2026
@ondrejmirtes After the latest push in 2.3.x, PHPStan now reports different result with your code snippet:
Full report
Foreach value variable $value is never read.phpstan-bot commentedon Sep 11, 2026
@ondrejmirtes After the latest push in 2.3.x, PHPStan now reports different result with your code snippet:
Full report
Foreach value variable $value is never read.Dumped type: int