0
Php Operators Module 3 Quiz
Hello. I dont understand why in question: What is the value of $b? $a=2; $b=$a++; True answer is 2. My answer was 3 but its wrong.
3 ответов
+ 1
Hello man,
In any module quiz, there the is a comment section at the bottom left. People usually give explanations of the answer there. Check it out to find why it is 2 and not 3.
+ 1
Consider thinking about the difference between pre-increment (++$a) and post-increment ($a++).
0
The increment is not with the variable "B". Rather it is incrementing "A" after assigning 2 to variable "B".
So, "A" is 2. "B" is assigned, Then "A" is incremented, not "B".