3v4l.org

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

preferences:
35.51 ms | 402 KiB | 5 Q