Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
takaram opened this issue Jan 28, 2024 · 2 comments · Fixed by phpstan/phpstan-src#2896
Closed

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

takaram opened this issue Jan 28, 2024 · 2 comments · Fixed by phpstan/phpstan-src#2896
Labels
Milestone

Comments

@takaram
Copy link

takaram commented Jan 28, 2024

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

@ondrejmirtes
Copy link
Member

Fixed phpstan/phpstan-src#2896

Copy link

github-actions bot commented Mar 3, 2024

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants