nerdexam
Zend

200-710 · Question #14

What is the output of the following code? $a = 'a', $b = 'b'; echo isset($c) ? $a.$b.$c : ($c = 'c').'d';

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

PHP Basics

Question

What is the output of the following code? $a = 'a', $b = 'b'; echo isset($c) ? $a.$b.$c : ($c = 'c').'d';

Options

  • Aabc
  • Bcd
  • CØd
  • D0d

How the community answered

(40 responses)
  • A
    13% (5)
  • B
    80% (32)
  • C
    5% (2)
  • D
    3% (1)

Topics

#ternary operator#isset#variable assignment#string concatenation

Community Discussion

No community discussion yet for this question.

Full 200-710 Practice