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; if (is_object($item) && $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)
8.3.70.0160.00616.48
8.3.60.0160.00316.63
8.3.50.0140.00721.20
8.3.40.0120.00318.83
8.3.30.0120.00318.67
8.3.20.0040.00420.34
8.3.10.0050.00323.66
8.3.00.0030.00523.48
8.2.190.0130.00716.58
8.2.180.0190.00018.16
8.2.170.0110.00422.96
8.2.160.0080.00820.53
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0080.00021.04
8.2.120.0050.00326.35
8.2.110.0100.00020.93
8.2.100.0090.00317.93
8.2.90.0080.00019.21
8.2.80.0000.00817.97
8.2.70.0110.00017.50
8.2.60.0070.00317.80
8.2.50.0040.00418.07
8.2.40.0000.00820.33
8.2.30.0080.00020.63
8.2.20.0000.00817.66
8.2.10.0000.00818.06
8.2.00.0040.00418.05
8.1.280.0120.00325.92
8.1.270.0080.00024.02
8.1.260.0040.00428.09
8.1.250.0000.00928.09
8.1.240.0030.00619.09
8.1.230.0030.00818.91
8.1.220.0040.00417.79
8.1.210.0030.00518.77
8.1.200.0060.00317.25
8.1.190.0000.00817.23
8.1.180.0080.00018.10
8.1.170.0040.00418.39
8.1.160.0070.00020.69
8.1.150.0040.00418.80
8.1.140.0040.00419.52
8.1.130.0000.00717.61
8.1.120.0040.00417.33
8.1.110.0040.00417.37
8.1.100.0040.00417.46
8.1.90.0080.00017.52
8.1.80.0000.00917.48
8.1.70.0030.00617.39
8.1.60.0050.00317.59
8.1.50.0030.00617.54
8.1.40.0040.00417.44
8.1.30.0040.00417.63
8.1.20.0060.00317.55
8.1.10.0090.00017.62
8.1.00.0040.00417.55
8.0.300.0080.00018.77
8.0.290.0050.00316.88
8.0.280.0030.00318.41
8.0.270.0000.00717.17
8.0.260.0000.00717.17
8.0.250.0030.00317.09
8.0.240.0000.00717.08
8.0.230.0040.00416.99
8.0.220.0070.00016.85
8.0.210.0040.00416.89
8.0.200.0030.00316.93
8.0.190.0060.00617.02
8.0.180.0000.00716.86
8.0.170.0030.00516.94
8.0.160.0000.00716.85
8.0.150.0030.00316.98
8.0.140.0000.00716.84
8.0.130.0030.00313.45
8.0.120.0050.00316.92
8.0.110.0000.00716.90
8.0.100.0050.00216.81
8.0.90.0050.00216.79
8.0.80.0060.00916.91
8.0.70.0040.00416.82
8.0.60.0030.00616.78
8.0.50.0050.00316.96
8.0.30.0140.00717.23
8.0.20.0110.01017.40
8.0.10.0050.00216.90
8.0.00.0110.01016.76
7.4.330.0000.00516.73
7.4.320.0030.00316.50
7.4.300.0030.00316.60
7.4.290.0050.00316.52
7.4.280.0060.00616.50
7.4.270.0030.00316.62
7.4.260.0040.00416.61
7.4.250.0070.00016.45
7.4.240.0020.00516.51
7.4.230.0040.00416.63
7.4.220.0100.00916.69
7.4.210.0090.01016.54
7.4.200.0000.00716.70
7.4.160.0060.01216.54
7.4.150.0110.00717.40
7.4.140.0120.01317.86
7.4.130.0070.01316.57
7.4.120.0060.01216.57
7.4.110.0080.01216.48
7.4.100.0090.00916.52
7.4.90.0060.01316.33
7.4.80.0220.00019.39
7.4.70.0150.00016.56
7.4.60.0130.00316.59
7.4.50.0130.00616.28
7.4.40.0180.00616.59
7.4.30.0090.01316.66
7.4.00.0050.00514.94
7.3.330.0000.00513.38
7.3.320.0000.00513.34
7.3.310.0040.00416.35
7.3.300.0000.00716.25
7.3.290.0020.00516.25
7.3.280.0080.00716.38
7.3.270.0130.00817.40
7.3.260.0060.01216.34
7.3.250.0060.01216.33
7.3.240.0110.00916.57
7.3.230.0120.00616.42
7.3.210.0150.00916.68
7.3.200.0120.00616.57
7.3.190.0070.01116.55
7.3.180.0190.00016.66
7.3.170.0100.01016.47
7.3.160.0040.01216.33
7.2.330.0030.01816.79
7.2.320.0110.00816.64
7.2.310.0170.00016.70
7.2.300.0080.00816.64
7.2.290.0090.01216.75
7.2.110.0060.01316.44
7.2.60.0000.01116.74
7.2.00.0030.00919.28
7.1.200.0100.00315.76
7.1.100.0060.00617.92
7.1.70.0050.00216.92
7.1.60.0060.01519.06
7.1.50.0070.01517.05
7.1.00.0030.07722.41
7.0.200.0100.00714.77
7.0.60.0100.08021.72
7.0.50.0070.04717.88
7.0.40.0070.06320.13
7.0.30.0270.07320.11
7.0.20.0230.07020.33
7.0.10.0170.07720.07
7.0.00.0230.07020.37
5.6.280.0000.04020.87
5.6.210.0170.05720.57
5.6.200.0100.08318.12
5.6.190.0100.08320.50
5.6.180.0270.04320.63
5.6.170.0130.04320.55
5.6.160.0070.09020.51
5.6.150.0030.04018.16
5.6.140.0070.03718.18
5.6.130.0030.04318.11
5.6.120.0030.06320.99
5.6.110.0130.07720.99
5.6.100.0100.07720.99
5.6.90.0070.03720.97
5.6.80.0070.06720.54
5.5.350.0370.06020.41
5.5.340.0170.07018.05
5.5.330.0070.04720.26
5.5.320.0230.04020.36
5.5.310.0130.04720.38
5.5.300.0000.04318.07
5.5.290.0030.05017.94
5.5.280.0030.07020.77
5.5.270.0100.08320.68
5.5.260.0030.09020.84
5.5.250.0030.05720.70
5.5.240.0270.03720.24

preferences:
51.27 ms | 401 KiB | 5 Q