psalm icon indicating copy to clipboard operation
psalm copied to clipboard

TooManyArguments doesn't work for call_user_func

Open kkmuffme opened this issue 2 years ago • 1 comments

https://psalm.dev/r/a1d15398f9

Basics were implemented in https://github.com/vimeo/psalm/issues/726 though

kkmuffme avatar Sep 25 '22 01:09 kkmuffme

I found these snippets:

https://psalm.dev/r/a1d15398f9
<?php

function foo(string $a) : void {}

foo("hello", 4);

call_user_func( 'foo', "hello", 4);
Psalm output (using commit 028ac7f):

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

psalm-github-bot[bot] avatar Sep 25 '22 01:09 psalm-github-bot[bot]

Turns out it's not only this issue but all issues that don't work - see https://github.com/vimeo/psalm/issues/10744

kkmuffme avatar Feb 23 '24 20:02 kkmuffme