看板 PHP 關於我們 聯絡資訊
剛剛我在別的版看到別人分享的連結 看完以後覺得很有趣, 轉貼至此 http://nikic.github.com/2011/12/12/How-big-are-PHP-arrays-really-Hint-BIG.html 本篇文章最後有提到說 如果沒有要用動態陣列, 可以使用 <?php $startMemory = memory_get_usage(); $array = new SplFixedArray(100000); for ($i = 0; $i < 100000; ++$i) { $array[$i] = $i; } echo memory_get_usage() - $startMemory, ' bytes'; 大概可以省下62%的記憶體 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 114.25.153.243 ※ 編輯: Wush978 來自: 114.25.153.243 (12/17 17:46)
olctw:還有,索引只能用數字;) 12/17 21:21
MOONRAKER:那不就只有大量計算的number cruncher才適用了。 12/17 23:59
kusoayan:挺酷的XD 12/18 02:18