Zend
200-710 · Question #225
What is the output of the following code? `` $a=1; $b=2; $c=3; Print (++$a) + (++$b) + (++$c) + ($a++) + (++$b) + ($c++); ``
The correct answer is A. 18. See the full explanation below for the reasoning.
PHP Basics
Question
What is the output of the following code?
$a=1;
$b=2;
$c=3;
Print (++$a) + (++$b) + (++$c) + ($a++) + (++$b) + ($c++);
Options
- A18
- B
- C
- D
How the community answered
(45 responses)- A71% (32)
- B9% (4)
- C4% (2)
- D16% (7)
Topics
#pre-increment#post-increment#operator precedence#arithmetic
Community Discussion
No community discussion yet for this question.