This is how i used todo my for loops, it's called post-increment:
for ($i = 0; $i < 10; $i++) {}
- the value of
$icopied to an internal temporary variable $iis incremented- the internal copy of the old value of
$iis returned
This is called pre-increment and it's 10% faster!
for ($i = 0; $i < 10; ++$i) {}
$iis incremented- the new value is returned