PrepAway - Latest Free Exam Questions & Answers

what statement is correct?

Given the following two functions, what statement is correct?
<code>
function dynamicNew($name) {
return new $name;
}
function reflectionNew($name) {

$r = new ReflectionClass($name);
return $r->newInstanceArgs();
}
</code>

PrepAway - Latest Free Exam Questions & Answers

A.
Both functions do the same

B.
dynamicNew() results in a parse error, reflectionNew() works

2 Comments on “what statement is correct?


Leave a Reply

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