nerdexam
Zend

200-710 · Question #44

200-710 Question #44: Real Exam Question with Answer & Explanation

Sign in or unlock 200-710 to reveal the answer and full explanation for question #44. The question stem and answer options stay visible for context.

Question

Consider the following code. What change must be made to the class for the code to work as written? class Magic { protected $v = array("a" => 1, "b" => 2, "c" => 3); public function __get($v) { return $this->v[$v]; } } $m = new Magic(); $m->d = 4; echo $m->d;

Options

  • ANothing, this code works just fine.
  • BAdd __set method using $this->v[$var] = $val
  • CRewrite __get as public function _get($v)
  • DRewrite __get as public function & _get($v)
  • EMake _get method static

Unlock 200-710 to see the answer

You've previewed enough free 200-710 questions. Unlock 200-710 for full answers, explanations, the timed quiz mode, progress tracking, and the master PDF. Question stem and options stay visible so you can still see what's on the exam.

Full 200-710 Practice