Look here for a similar example.
This is basically what happens:
The first one is evaluated ++$i. $inow equals 2.
$i += 2 + $i++ + ++$i;
Further evaluated $i++. $inow 3.
$i += 2 + 2 + ++$i;
++$i. $i 4.
$i += 2 + 2 + 4;
, :
$i = 4 + 2 + 2 + 4 = 12