- memory_get_usage: documentation ( source)
- number_format: documentation ( source)
<?php
class Foo {
function __construct()
{
$this->bar = new Bar($this);
}
}
class Bar {
function __construct($foo = null)
{
$this->foo = $foo;
}
}
$i = 1;
while ($i > 1000) {
$foo = new Foo();
unset($foo);
if ($i > 990) {
echo number_format(memory_get_usage()) . "\n";
}
$i++;
}