- function_exists: documentation ( source)
- memory_get_usage: documentation ( source)
<?php
function usage()
{
if (function_exists('memory_get_usage')) {
return memory_get_usage(true);
} else {
return '?';
}
}
echo usage()."\n";
$x = '.';
$a = '';
for ($i=0;$i<1000;$i++)
//$a = "$a$x";
$a = $a.$x;
echo usage()."\n";
unset($a,$x);
echo usage()."\n";