PrepAway - Latest Free Exam Questions & Answers

what is correct?

Given the following code, what is correct?
<code>
function f(stdClass &$x = NULL) { $x = 42;
}
$z = new stdClass;
f($z);
var_dump($z);
</code>

PrepAway - Latest Free Exam Questions & Answers

A.
Error: Typehints cannot be NULL

B.
Error: Typehints cannot be references

C.
Result is NULL

D.
Result is object of type stdClass

E.
Result is 42


Leave a Reply

Your email address will not be published. Required fields are marked *