[1 => 'method_name', 0 => $obj]
is not recognized as calllable
#10502
Labels
Milestone
[1 => 'method_name', 0 => $obj]
is not recognized as calllable
#10502
Bug report
An array is regarded as callable when
$arr[0]
is an object and$arr[1]
is the method name of the object.This is true even when iteration order is reversed.
https://3v4l.org/f3HDi
However PHPStan fails does not know that.
Code snippet that reproduces the problem
https://phpstan.org/r/22110120-3171-45ce-8097-ceec1e8ba1d3
Expected output
No errors, since
is_callable($callable2)
is always true likeis_callable($callable1)
Did PHPStan help you today? Did it make you happy in any way?
No response
The text was updated successfully, but these errors were encountered: