200-710 Exam QuestionsBrowse all questions from this exam

200-710 Exam - Question 38


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

Show Answer
Correct Answer: A,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

1 comment
Sign in to comment
KirillSOptions: BC
Apr 9, 2021

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