Sarabande.jp: 厳密な比較演算子、isset()、is_null() の速さを比較
前の記事を書いたあとで isset() 関数のことを忘れたので、追記。厳密な演算子と isset() 関数はほとんど同じぐらいで、is_null() 関数は約1.7倍遅い結果になった。
function benchmark(callable $block) { $start = microtime(true); for ($i = 0; $i < 100000; $i += 1) { $block(); } $end = microtime(true); return $end - $start; } $a = null; echo...
6ヶ月前 | 固定リンク | 2011年 10月 29日 | 
