Which interfaces could class C implement in order to allow each statement in the following code to work? (Choose 2)$obj = new C();foreach ($obj as $x => $y) {echo $x, $y;}
Answer(s): A,C
What is the output of the following code?class Foo Implements ArrayAccess {function offsetExists($k) { return true;}function offsetGet($k) {return 'a';}function offsetSet($k, $v) {}function offsetUnset($k) {}}$x = new Foo();echo array_key_exists('foo', $x)?'true':'false';
Answer(s): B
What is the output of the following code?class Bar {private $a = 'b';public $c = 'd';}$x = (array) new Bar();echo array_key_exists('a', $x) ? 'true' : 'false';echo '-';echo array_key_exists('c', $x) ? 'true' : 'false';
What is the output of the following code?$a = array('a', 'b'=>'c');echo property_exists((object) $a, 'a')?'true':'false';echo '-';echo property_exists((object) $a, 'b')?'true':'false';
Post your Comments and Discuss Zend 200-550 exam with other Community members:
To protect our content from bots for real learners like you, we ask you to register for free. Sign in or sign up now to continue with the 200-550 material!