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
incorrect type narrowing with combination of two dependent variables #14191
Activity
claudepache commentedon Feb 23, 2026
Simplified testcase:
Code snippet that reproduces the problem
https://phpstan.org/r/b28b8c9b-f4c8-40b2-ada3-c883650199a2
Expected output
claudepache commentedon Feb 24, 2026
Strangely, if I declare $list_of_ids as
array<int>instead oflist<int>, the bug disappears:https://phpstan.org/r/bccbbab6-70a2-4355-9d2e-d37400cb0c1d
phpstan-bot commentedon Feb 24, 2026
@claudepache After the latest push in 2.2.x, PHPStan now reports different result with your code snippet:
Full report
Dumped type: falseDumped type: boolDumped type: boolDumped type: truephpstan-bot commentedon Feb 24, 2026
@claudepache After the latest push in 2.2.x, PHPStan now reports different result with your code snippet:
Full report
Dumped type: boolondrejmirtes commentedon Feb 24, 2026
Fixed: phpstan/phpstan-src@3993c52
claudepache commentedon Feb 24, 2026
That was fast! Thank you.
github-actions commentedon Mar 28, 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.