nerdexam
Zend

200-550 · Question #39

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 offse

The correct answer is B. false. See the full explanation below for the reasoning.

Question

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

Options

  • Atrue
  • Bfalse

How the community answered

(30 responses)
  • A
    23% (7)
  • B
    77% (23)

Community Discussion

No community discussion yet for this question.

Full 200-550 Practice