<?php
var_dump(ini_get('memory_limit'));
function memstat($file, $line) {
echo sprintf(
'mem @ %s %d: %.2f MB (%.2f MB; peak: %.2f MB)' . PHP_EOL,
$file,
$line,
memory_get_usage() /2**20,
memory_get_usage(true) /2**20,
memory_get_peak_usage() /2**20
);
}
memstat(__FILE__, __LINE__);
$str = str_pad('', 9999999, ' ');
memstat(__FILE__, __LINE__);
print 'end '.strlen($str);
preferences:
23.48 ms | 409 KiB | 5 Q