1 2 3 4 5 6 7 8 9 10 11 12 13
<?php function printUsedMemory($arr) { $start_memory = memory_get_usage(); $arr[0] = 1; // WRITE! echo memory_get_usage() - $start_memory; // let's see the memory used whilst reading } $x = array_fill(0, 10000, 1); printUsedMemory($x);
1
505644