nerdexam
Zend

200-550 · Question #40

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…

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

Question

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

Options

  • Afalse-false
  • Bfalse-true
  • Ctrue-false
  • Dtrue-true

How the community answered

(18 responses)
  • A
    6% (1)
  • B
    72% (13)
  • C
    17% (3)
  • D
    6% (1)

Community Discussion

No community discussion yet for this question.

Full 200-550 Practice