200-710 practice question 6 of 30

What is the output of the following code? class a { public $val; } function renderVal (a $a) { if ($a) { echo $a->val; } } renderVal (null);

Full set: 232 questions
Answer options
A: A syntax error in the function declaration line
B: An error, because null is not an instance of 'a' Correct answer
C: Nothing, because a null value is being passed to renderVal()
D: NULL
Correct Answer:
B. An error, because null is not an instance of 'a'
Scroll to Top