Today's puzzle · #17 · PHP
Post- and pre-increment together
Sunday, 29 November 2026 · One try
What does this code print?
$i = 5;
echo $i++ + ++$i;
Correct! Not this time. The answer: 12
$i++ gives 5 and then makes $i 6. ++$i makes it 7 and gives 7. 5 + 7 = 12. Code like this is legal but hard to read: avoid it.