Bug report
Calling call_user_func() with array as callable where class is of type class-string<MyClass> fails with Parameter #1 $function of function call_user_func expects callable(): mixed, array(class-string<MyClass>, 'MyMethod') given. Class MyClass has method of that name defined.
- Calling
call_user_func([$classname, 'MyMethod']) wrongly produces error.
- But trying to call
$classname::MyMethod() correctly produces no error. (as on line 23 in snippet)
Code snippet that reproduces the problem
https://phpstan.org/r/5d8ce00e-ba5b-4b49-84f6-3ba603c0ba2f
Expected output
Bug report
Calling
call_user_func()with array as callable where class is of typeclass-string<MyClass>fails withParameter #1 $function of function call_user_func expects callable(): mixed, array(class-string<MyClass>, 'MyMethod') given.Class MyClass has method of that name defined.call_user_func([$classname, 'MyMethod'])wrongly produces error.$classname::MyMethod()correctly produces no error. (as on line 23 in snippet)Code snippet that reproduces the problem
https://phpstan.org/r/5d8ce00e-ba5b-4b49-84f6-3ba603c0ba2f
Expected output