Late static binding is used in PHP to:
Answer(s): B
What is the output of the following code?class Test {public function __call($name, $args){call_user_func_array(array('static', "test$name"), $args);}public function testS($l) {echo "$l, ";}}class Test2 extends Test {public function testS($l) {echo "$l, $l, ";}}$test = new Test2();$test->S('A');
Which of the following tasks can be achieved by using magic methods? (Choose 3)
Answer(s): A,D,F
How should class MyObject be defined for the following code to work properly? Assume $array is an array and MyObject is a user-defined class.$obj = new MyObject();array_walk($array, $obj);
Answer(s): D
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[0];
Post your Comments and Discuss Zend 200-550 exam prep with other Community members: