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&callable is not reported as a wrong param #14549
callable&array offsets and iterable value are understood as object|non-falsy-string but the value is not reported when passed as a param to another method. Even if the array is still understood as array<mixed> it should have been reported on level 9-10 (but best would be on lower level).
@@ @@
8: Method MondayMorning::foo() has parameter $task with no value type specified in iterable type array.
11: Dumped type: array&callable(): mixed
12: Dumped type: class-string|object
-13: Dumped type: string+13: Dumped type: non-falsy-string
Full report
Line
Error
8
Method MondayMorning::foo() has parameter $task with no value type specified in iterable type array.
Activity
ondrejmirtes commentedon Apr 29, 2026
We could just fix MissingTypehintCheck.
[-]array&callable is not narrowed enough[/-][+]array&callable is not reported as a wrong param[/+]phpstan-bot commentedon Apr 30, 2026
@VincentLanglet After the latest push in 2.2.x, PHPStan now reports different result with your code snippet:
Full report
Method MondayMorning::foo() has parameter $task with no value type specified in iterable type array.Dumped type: array&callable(): mixedDumped type: non-falsy-stringphpstan-bot commentedon Apr 30, 2026
@VincentLanglet After the latest push in 2.2.x, PHPStan now reports different result with your code snippet:
Full report
Method MondayMorning::foo() has parameter $task with no value type specified in iterable type array.Dumped type: array&callable(): mixedDumped type: non-falsy-stringphpstan-bot commentedon May 7, 2026
Closed via merging phpstan/phpstan-src#5573
github-actions commentedon Jun 8, 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.