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

Support proper evaluation of call_user_func v2 #10744

Open
kkmuffme opened this issue Feb 23, 2024 · 2 comments
Open

Support proper evaluation of call_user_func v2 #10744

kkmuffme opened this issue Feb 23, 2024 · 2 comments

Comments

@kkmuffme
Copy link
Contributor

#726 was closed with it being implemented, however it only works with non-named functions and isn't implemented for most cases at all.

https://psalm.dev/r/196d11643d

Copy link

I found these snippets:

https://psalm.dev/r/196d11643d
<?php

function foo(string $a) : void {}

foo(18, 4);

call_user_func( 'foo', 18, 4);
Psalm output (using commit c488d40):

ERROR: InvalidScalarArgument - 5:5 - Argument 1 of foo expects string, but 18 provided

ERROR: TooManyArguments - 5:1 - Too many arguments for foo - expecting 1 but saw 2

@kkmuffme
Copy link
Contributor Author

Will fix this once #10745 is merged since it's partially similar/dependend

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants