These pages have a few benchmark tests for PHP4 perfomance to do the same thing using different methods.:


READ LOOP: foreach() vs. while(list()=each())
MODIFY LOOP: foreach() vs. while(list()=each())
For-loop test
Using the &-ref-operator as so called “alias”
$obj = new SomeClass() vs. $obj =& new SomeClass() using the =&-ref-operator
double (“) vs. single (‘) quotes
sSet() vs. empty() vs. is_array()
switch/case vs. if/elseif

Creating int array[100 000]
Reading int array[100 000]
Reading apache log (16Mb)
Parse vars names [100 000]
Parse and find text from apache log (32Mb)
Split text apache log 200Kb (contain 2000 “-“)
Count array size. $arr = int[100 000]
Create object by Ref (loop 100 000)
Random number generator (loop 100 000)
Calculate hash (loop 100 000)

NB Refresh the pages a few times, the results change as webserver load differs.