Bug report
PHPStan incorrectly reports a parameter count error when calling a static method named add with optional parameters. The error completely disappears if the method is renamed to any other name, suggesting an internal conflict or name resolution issue specific to the name "add".
Code snippet that reproduces the problem
https://phpstan.org/r/53c25855-1d03-4347-909a-2eb06f8febad
Expected output
No error should be reported as the call self::add('a',[]) is perfectly valid PHP: it provides 2 parameters for a method that accepts 1 required + 1 optional parameter.
Did PHPStan help you today? Did it make you happy in any way?
No response