Skip to content

[1 => 'method_name', 0 => $obj] is not recognized as calllable #10502

@takaram

Description

@takaram

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 like is_callable($callable1)

Did PHPStan help you today? Did it make you happy in any way?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions