nerdexam
Zend

200-710 · Question #88

How do you allow the caller to submit a variable number of arguments to a function?

The correct answer is B. Using a prototype like function test() and the function func_get_args() inside the function body. See the full explanation below for the reasoning.

Functions

Question

How do you allow the caller to submit a variable number of arguments to a function?

Options

  • AUsing a prototype like function test(...$parameters);
  • BUsing a prototype like function test() and the function func_get_args() inside the function body.
  • CUsing a prototype like function test($parameters[]);
  • DUsing a prototype like function test() and the function get_variable_args() inside the function body.
  • EThis is not possible in PHP.

How the community answered

(29 responses)
  • A
    3% (1)
  • B
    79% (23)
  • D
    10% (3)
  • E
    7% (2)

Topics

#variadic functions#func_get_args#variable arguments

Community Discussion

No community discussion yet for this question.

Full 200-710 Practice