It's a simple enough question, which you should try to solve in your head: What does the following code display, and why?
<?php
$i = 1;
$i += $i++ + ++$i;
echo 'i=', $i;
?>
Bonus question: Is the result always the same in other programming languages (JavaScript, Java, C#, ...; provided the syntax is adapted to the host language :))? Why (not)?
Posted by karma at 19:44:37. Filed under: Other Programming

Comments
Add Comment