-
-
Notifications
You must be signed in to change notification settings - Fork 862
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
calling static methods using call_user_func #1105
Comments
Probably same issue as I found for Code snippet that reproduces the problemhttps://phpstan.org/r/32d948199501e310faa5fdcd309ab633 Live example |
The See the https://wiki.php.net/rfc/consistent_callables for more details about why |
The |
I plan to add some kind of |
I'm gonna close this issue if this RFC passes: https://wiki.php.net/rfc/deprecate_partially_supported_callables |
The RFC passed, but I don't think the issue should be closed The error https://phpstan.org/r/c1ba1e32-2cc0-49bc-9e33-8de4a1c101b3 seems related to this issue, but according to the RFC
|
The RFC has not yet passed as the voting closes on 22nd October. @VincentLanglet Your issue is unrelated and PHPStan's behaviour is expected here. You have no guarantees that Also note that the example you copied here passes: https://phpstan.org/r/f24c3a2f-e190-49f3-b94e-73a314dcc7e2 |
I see, my bad and thanks. |
@VincentLanglet After the latest commit in dev-master, PHPStan now reports different result with your code snippet: @@ @@
PHP 8.0 (1 error)
==========
-10: Parameter #1 $callback of function call_user_func expects callable(): mixed, array(class-string, string) given.
+10: Parameter #1 $callback of function call_user_func expects callable(): mixed, array{class-string, string} given.
PHP 7.1 – 7.4 (1 error)
==========
-10: Parameter #1 $function of function call_user_func expects callable(): mixed, array(class-string, string) given.
+10: Parameter #1 $function of function call_user_func expects callable(): mixed, array{class-string, string} given. Full reportPHP 8.0 (1 error)
PHP 7.1 – 7.4 (1 error)
|
The RFC passed. |
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. |
Summary of a problem or a feature request
calling static method using call_user_func gives error that it expects callable and is given string / array<int, string>.
Code snippet that reproduces the problem
https://phpstan.org/r/e9f9cd7e41d9a0f4b473d0ec902c762c
Expected output
no error
The text was updated successfully, but these errors were encountered: