- var_dump: documentation ( source)
- memory_get_usage: documentation ( source)
<?php
class Foo {
public $bar = 1;
public $baz = 2;
public $qux = 3;
}
$a = [];
for ($i = 0; $i < 1000; $i++) {
$a[] = new Foo();
}
var_dump(memory_get_usage());
foreach ($a as $o) {
foreach ($o as $p) {}
}
var_dump(memory_get_usage());