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)- A13% (5)
- B80% (32)
- C5% (2)
- D3% (1)
Topics
#ternary operator#isset#variable assignment#string concatenation
Community Discussion
No community discussion yet for this question.