【PHP】下らねぇ質問はID出して書き込みやがれ 107
レス数が950を超えています。1000を超えると書き込みができなくなります。
0951nobodyさん
2011/07/02(土) 04:42:20.39ID:???散々既出だが・・・
http://php.net/manual/ja/function.count.php#46542
> When running loops with count conditions, the code runs faster
> if you first assign the count() value to a variable and use that
> (instead of using count() directly in a loop condition.
> As you can see, the second method (which doesnt use count() directly
> in the loop) is faster than the first method (which uses count() directly
> in the loop).
つーことで結論は出てるよ。
PHPのコンパイラがどの程度最適化してくれるのか知らんけど
後者の方が早いのは想像に難くない。
レス数が950を超えています。1000を超えると書き込みができなくなります。