3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Foo { private $orig; public function bar() { $this->orig = clone $this; } } $foo = new Foo; $history = []; $last = 0; for ($i = 0; $i < 500; $i++) { $foo->bar(); $peak = round(memory_get_peak_usage(true) / 1024 / 1024, 2); if ($peak != $last) { $history[] = $peak; $last = $peak; } } var_dump($history);
based on 7PRN5

Shows result from various feature-branches currently under review from the php developers. Contact me to have additional branches featured.

Output for Typed properties v2
array(1) { [0]=> float(2) }
Output for Array change keys
array(1) { [0]=> float(2) }
Output for Lexical anon
array(1) { [0]=> float(2) }

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page