func_num_args
func_num_args
Returns the number of arguments passed to the function
int **func_num_args**
Gets the number of arguments passed to the function.
This function may be used in conjunction with
and
to allow user-defined functions to accept variable-length argument lists.
func_get_arg``func_get_args
Returns the number of arguments passed into the current user-defined function.
Generates a warning if called from outside of a user-defined function.
Voorbeeld: example
<?php
function foo()
{
echo "Number of arguments: ", func_num_args(), PHP_EOL;
}
foo(1, 2, 3);
?>
Number of arguments: 3
... syntaxfunc_get_arg``func_get_args``ReflectionFunctionAbstract::getNumberOfParameters