nerdexam
Zend

200-710 · Question #67

QUESTION 70 What is the output of the following code? $a = array('a' => '1', 'c'); echo property_exists((object)$a, 'a') ? 'true' : 'false'; echo '-'; echo property_exists((object)$a, 'b') ? 'true'…

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

Arrays

Question

QUESTION 70 What is the output of the following code? $a = array('a' => '1', 'c'); echo property_exists((object)$a, 'a') ? 'true' : 'false'; echo '-'; echo property_exists((object)$a, 'b') ? 'true' : 'false';

Options

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

How the community answered

(38 responses)
  • A
    8% (3)
  • B
    74% (28)
  • C
    16% (6)
  • D
    3% (1)

Topics

#array to object casting#property_exists#object properties#type juggling

Community Discussion

No community discussion yet for this question.

Full 200-710 Practice