- 1
Operators
What is the value of $b? $a=2; $b=$a++; why not 3?
3 Answers
+ 1
Because with post increment($a++) value of $a is assigned to $b. Then if you echo it out, you will see that it is 3. So it first assigns value of $a to $b and then increments it.
If there was ++$a, value would be 3, because it is PRE increment meaning it is incrementing and then assigning value.
Hope this helpedđđ
- 1
$Đ°=2 $b=$a++;
????????????