It makes bu**er all difference. I haven't done the disassably but I suspect that there is probably 1 opcode difference and since the PHP interpreter runs @ ~20M opcodes per second, you are looking at far less than one microsecond difference.
Just focus on clarity. Going backwards down a loop is being "clever" not smart, and the trouble with being clever is that you make mistakes.
What the disassembly tells us
Here are the two side-by side:
$i=0; $i<10000; $i++ $i=10000; $i--;
line # * op ext return operands line # * op ext return operands
0 > EXT_STMT 0 > EXT_STMT
1 ASSIGN !0, 0 1 ASSIGN !0, 10000
2 > IS_SMALLER ~1 !0, 10000 2 > POST_DEC ~1 !0
3 EXT_STMT 3 EXT_STMT
4 > JMPZNZ 8 ~1, ->11 4 > JMPZNZ 6 ~1, ->9
5 > POST_INC ~2 !0
6 FREE ~2
7 > JMP ->2 5 > > JMP ->2
8 > CONCAT ~3 !0, '%0A' 6 > CONCAT ~2 !0, '%0A'
9 ECHO ~3 7 ECHO ~2
10 > JMP ->5 8 > JMP ->5
as I said one or two opcodes diffferent.
Benchmarking this
This types type of benchmark shown in other answers are weak. Let me explain why in a nutshell: You need to benchmark the right thing and you need to take enough samples to be statistically significant. Here is my little test:
<?php
$stat = array ();
for( $j=0; $j<1001; $j++ ) {
$s1 = microtime( TRUE );
for( $i=0; $i<10000; $i++ ) $a = 0;
$s2 = microtime( TRUE );
for ( $i=10000; $i--; ) $a = 0;
$s3 = microtime( TRUE );
if( $j>0 ) $stat[]=array($s2-$s1, $s3-$s2,$s3-$s2-$s2+$s1);
}
foreach ($stat as $s) echo "{$s[0]}\t{$s[1]}\n";
This collect 100 samples of a 10K loop as about replacing the echo by a trivial statement. I loaded the O/P into a spread sheet and got a delta mean of 0.035 µSec with a std dev of 0.017 µSec inner loop. However if I replace the $a assignment by echo $1, this moves to 0.131 µSec average delta and a std dev of 0.185 µSec. This because the looptime is now 4.12 µSec.
Guys, OK we all may have come across stats which show post decrement is slightly better than predecrement, but it makes no real-world difference!!!!!