nerdexam
Zend

200-530 · Question #142

What is the output of the following code? $a = 3; switch ($a) { case 1: echo 'one'; break; case 2: echo 'two'; break; default: echo 'four'; break; case 3: echo 'three'; break; }

The correct answer is C. three. See the full explanation below for the reasoning.

Question

What is the output of the following code? $a = 3; switch ($a) { case 1: echo 'one'; break; case 2: echo 'two'; break; default: echo 'four'; break; case 3: echo 'three'; break; }

Options

  • Aone
  • Btwo
  • Cthree
  • Dfour

How the community answered

(44 responses)
  • A
    9% (4)
  • B
    16% (7)
  • C
    73% (32)
  • D
    2% (1)

Community Discussion

No community discussion yet for this question.

Full 200-530 Practice