0
Why <?php $a = 2; $b = $a++; echo $a; ?> is a=3 and b=3
I don't understand the result in this exercise. Result: $a=3, $b=3
3 odpowiedzi
+ 4
a=3 but b=2
because in $b=$a++ first b is set to the value of a , then a would be incremented. here you should know the difference of pre-increment and post-increment
+ 3
$a is 3 but i think $b is 2
0
Thanks 👍