"PHPの素朴な疑問とか - まちゅダイアリー"にて、ループに関するベンチマークの補足をしてもらいました。コンパイル時の最適化、というのは確かにあるのかもなあ... で、1~10000までの数値を要素とする配列を作る例について、今更感もあるが測定結果。 -------------------------------------------------------------- <?php require_once 'Benchmark/Timer.php'; $timer =& new Benchmark_Timer(TRUE); $array_1 = array(); for ($i = 0; $i < 10000; $i++) { $array_1[$i] = $i; } $timer->setMarker('$array[$i] = $i'); $array_2 = array();