0

Php

Say me this answer $a=2; $b=$a++; When I am executing it i am getting it as 2 but how.$a is incremented and assigned to $b know then I should get the value as 3 know but how give me explaination

19th Feb 2017, 8:26 AM
balavikram tadikonda
balavikram tadikonda - avatar
1 ответ
0
to get 3 as result, $b=++$a $a++ is post increment, return $a then increment by 1 ++$a is pre increment, increment by 1 then return $a
19th Feb 2017, 7:27 PM
Azh Setiawan
Azh Setiawan - avatar