$i++ has the disadvantage of generating a temporary variable when incremented, which does not happen with ++$i.
Avoid:
$i++
which generates 4 opcodes.
Use instead:
++$i
which only generates 3.