3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Item { public $name; public $parent; public function __construct($name, $parent = null) { $this->name = $name; $this->parent = $parent; } } function render(Item $item) { yield $item; while (is_object($item) { if ($item->parent) { yield from render($item->parent); } } } $a = new Item('a'); $b = new Item('b', $a); $c = new Item('c', $b); $d = new Item('d', $c); $e = new Item('e', $d); foreach (render($e) as $item) { var_dump($item); }

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
7.0.00.0100.06720.19
5.6.160.0070.04320.39
5.6.150.0030.04018.27
5.6.140.0070.03718.21
5.6.130.0070.09018.28
5.6.120.0070.08321.00
5.6.110.0200.07021.02
5.6.100.0170.07320.90
5.6.90.0100.06320.96
5.6.80.0170.07020.36
5.5.300.0070.03717.99
5.5.290.0000.08718.08
5.5.280.0100.08020.69
5.5.270.0100.07720.77
5.5.260.0100.08720.73
5.5.250.0170.07320.50
5.5.240.0000.04020.16

preferences:
140.67 ms | 1386 KiB | 7 Q