func_num_args

Returns the number of arguments passed to the function

&reftitle.description; `int` `func_num_args`

Gets the number of arguments passed to the function.

This function may be used in conjunction with `func_get_arg` and `func_get_args` to allow user-defined functions to accept variable-length argument lists.

&reftitle.parameters; &no.function.parameters;
&reftitle.returnvalues;

Returns the number of arguments passed into the current user-defined function.

&reftitle.errors;

Generates a warning if called from outside of a user-defined function.

&reftitle.examples;

### `func_num_args` example

    <?php
    function foo()
    {
        echo "Number of arguments: ", func_num_args(), PHP_EOL;
    }

    foo(1, 2, 3);
    ?>

&example.outputs;

    Number of arguments: 3

&reftitle.notes; ¬e.func-named-params;
&reftitle.seealso;

- `...` syntax
- `func_get_arg`
- `func_get_args`
- `ReflectionFunctionAbstract::getNumberOfParameters`