Too few arguments to function %s%s%s(), %d passed and %s %d expected¶
Description¶
This error reports that not enough parameters were used when calling a method or a function. All the arguments in the method signature are compulsory.
While there is an error message when there are missing arguments at call time, there is not error when too many arguments are provided.
Example¶
<?php
function foo($a, $b) {}
foo(1);
?>
Literal Examples¶
Too few arguments to function foo(), 1 passed and exactly 2 expected
Solutions¶
Provide more arguments to the method call.
Add default values to the missing parameters in the method signature.