这个PHP代码背后的逻辑并不清楚答案19.答案如何才能成为19?逻辑是什么?
$i=5;
$i +=$i++ + ++$i;
echo $i;
Run Code Online (Sandbox Code Playgroud)
Mar*_*ker 10
$i=5;
$i +=$i++ + ++$i;
^
Take value of $i as 5 then increment to 6
^
increment value of $i from 6 to 7, and use the 7
^
5 + 7 = 12
^ $i is already 7, because of the increments in the previous operations,
so add the 12 we've just calculated, giving 19
Run Code Online (Sandbox Code Playgroud)