- microtime: documentation ( source)
- round: documentation ( source)
- array_fill: documentation ( source)
<?php
$arr = array_fill(0, 100000, 'hello');
$start = microtime(true);
foreach ($arr as $ar) {}
echo 'Array Iteration :' . round(microtime(true) - $start, 4);
$start = microtime(true);
foreach (SplFixedArray::fromArray($arr) as $ar) {}
echo 'SPL Iteration :' . round(microtime(true) - $start, 4);