Please see this code, where I pass more parameters than expected to a custom function:
error_reporting(E_ALL);
ini_set(\"display_errors\", 1);
daidai(\"asassa\"
That is because the setTime()
method itself performs a check on the number of parameters, if you want it in your functions, you have to implement it yourself.
For reference you might look into the docs for func_num_args(), func_get_arg() and func_get_args()
From the docs:
No special syntax is required to note that a function is variadic; however access to the function's arguments must use func_num_args(), func_get_arg() and func_get_args().
Hence, php really treats every function as a variadic one.