Exam 200-710 All QuestionsBrowse all questions from this exam
Question 38

How do you allow the caller to submit a variable number of arguments to a function? (Choose two.)

    Correct Answer: B, D

    To allow the caller to submit a variable number of arguments to a function in PHP, you can use a function prototype with empty parentheses and then access those arguments using the func_get_args() function within the function body. Another correct approach is to use the function get_variable_args() inside the function body when the prototype is defined similarly. Option A appears to have incorrect syntax and does not properly describe a valid method for handling variable arguments in PHP.

Discussion
KirillSOptions: BC

A is incorrect, or maybe here some encoding issue. 'function test("¦$parameters)' makes no sense. function test(...$parameters) must be the right answer