01-10-2008, 12:50 AM
|
#3 (permalink)
|
|
Moderateur
Join Date: Apr 2007
Posts: 1,381
Thanks: 5
|
Hmm interesting. I tried three different approaches (array_map, for, foreach) with the following results.
Code:
Test took 7.684968 seconds to complete
Test array has 100 items
Average of 10,000 iterations, times in 1000ths of a second
array_map => 0.107439
foreach => 0.327824
for => 0.322589
Given those results, which contradict your own, it would appear that array_map is around 3 times faster than for/foreach -- for me at least.
|
|
|
|