- memory_get_usage: documentation ( source)
- range: documentation ( source)
<?php
$startMemory = memory_get_usage();
$array = range(1, 100000);
foreach($array as $arr){
if($k%100 == 0){
echo memory_get_usage() - $startMemory, ' bytes';
}
}
echo 'Finnally' . memory_get_usage() - $startMemory, ' bytes';
This script was stopped while abusing our resources