nerdexam
National_Instruments

200-500 · Question #106

What is the output of the following code? 1 <?php 2 $a = 'a'; $b = 'b'; 3 echo isset($c) ? $a.$b.$c : ($c = 'c').'d'; 4 ?>

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

Question

What is the output of the following code? 1 <?php 2 $a = 'a'; $b = 'b'; 3 echo isset($c) ? $a.$b.$c : ($c = 'c').'d'; 4 ?>

Options

  • Aabc
  • Bcd
  • C0d

How the community answered

(37 responses)
  • A
    11% (4)
  • B
    84% (31)
  • C
    5% (2)

Community Discussion

No community discussion yet for this question.

Full 200-500 Practice