3v4l.org

run code in 300+ PHP versions simultaneously
<?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());

preferences:
21.39 ms | 405 KiB | 5 Q