Closed foobar13372 closed 2 years ago
https://3v4l.org/NMrv2/vld
$i = 1; echo $i++ + ++$i;
PHP correctly returns 4 because it adds 1 + 3. VLD however says for the operands ~2, ~3 - which is clearly wrong (but the result ~4 is correct).
~2, ~3
~4
VLD doesn't show the values, but the (internal) variable number that the PHP engine uses. Change your initial value to something else (say 42) and the VLD output will be the same.
https://3v4l.org/NMrv2/vld
PHP correctly returns 4 because it adds 1 + 3. VLD however says for the operands
~2, ~3
- which is clearly wrong (but the result~4
is correct).