Free 200-550 Exam Braindumps (page: 17)

Page 16 of 56

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;
}

  1. Iterator
  2. ArrayAccess
  3. IteratorAggregate
  4. ArrayObject

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';

  1. true
  2. 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';

  1. false-false
  2. false-true
  3. true-false
  4. true-true

Answer(s): B



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';

  1. false-false
  2. false-true
  3. true-false
  4. true-true

Answer(s): B






Post your Comments and Discuss Zend 200-550 exam with other Community members:

200-550 Discussions & Posts