PHPのインクリメント・デクリメント演算子をベンチしてみた
ちょっと気になったので実行してみた。
使っているPHPのバージョンは5.2.5
実行コード
$hoge = 0; $start = microtime(true); for($i=0; $i<10000000; $i++ ){ $hoge++; } $end = microtime(true); echo 'hoge++ time : '.($end - $start).'<br>'; $hoge = 0; $start = microtime(true); for($i=0; $i<10000000; $i++ ){ ++$hoge; } $end = microtime(true); echo '++hoge time : '.($end - $start).'<br>';