3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class Foo { function __construct() { $this->bar = new Bar($this); } } class Bar { function __construct($foo = null) { $this->foo = $foo; } } $usage = 0; $maxima = array(); while (count($maxima) < 5 && $usage < 50000000) { $foo = new Foo(); unset($foo); $last = $usage; $usage = memory_get_usage(); if ($usage < $last) { $maxima[] = $last; } echo number_format($usage)."\n"; } printf("\n\nMaxima: %s\n", implode('; ', $maxima)); ?>