3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Item { public static function &newWithParent(Item $parent) { $item = new Item(); $item->parent = $parent; return $item; } private $parent; public function &getParent() { return $this->parent; } } $item = Item::newWithParent(Item::newWithParent(Item::newWithParent(new Item()))); // Basically it's this now: {"parent":{"parent":{"parent":{"parent":null}}}} // I want to set that null value $list = $item; do { $item = $item->getParent(); if ($item->getParent() === null) { $item = Item::newWithParent($item); break; } } while (true); var_dump($list);

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.60.0190.00016.88
8.3.50.0140.00717.48
8.3.40.0150.00018.76
8.3.30.0070.00718.59
8.3.20.0040.00418.69
8.3.10.0030.00618.56
8.3.00.0040.00419.51
8.2.180.0130.00617.00
8.2.170.0140.00722.96
8.2.160.0080.01118.82
8.2.150.0040.00424.18
8.2.140.0030.00524.66
8.2.130.0040.00426.16
8.2.120.0040.00419.54
8.2.110.0100.00022.29
8.2.100.0120.00017.78
8.2.90.0060.00319.23
8.2.80.0000.00817.97
8.2.70.0030.00617.38
8.2.60.0050.00317.80
8.2.50.0040.00417.91
8.2.40.0000.00819.30
8.2.30.0040.00417.61
8.2.20.0040.00517.70
8.2.10.0030.00517.69
8.2.00.0000.00717.57
8.1.280.0040.01425.92
8.1.270.0040.00423.99
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0040.00423.88
8.1.230.0080.00417.64
8.1.220.0030.00517.74
8.1.210.0000.00818.77
8.1.200.0080.00017.22
8.1.190.0000.01117.23
8.1.180.0040.00418.10
8.1.170.0070.00417.62
8.1.160.0000.00719.07
8.1.150.0030.00518.64
8.1.140.0040.00417.32
8.1.130.0070.00017.40
8.1.120.0040.00417.47
8.1.110.0060.00317.44
8.1.100.0040.00417.29
8.1.90.0000.00717.43
8.1.80.0040.00417.30
8.1.70.0030.00317.38
8.1.60.0000.00817.63
8.1.50.0000.00717.39
8.1.40.0030.00517.55
8.1.30.0000.00817.55
8.1.20.0030.00617.69
8.1.10.0040.00417.56
8.1.00.0000.00717.35
8.0.300.0040.00418.77
8.0.290.0000.00716.63
8.0.280.0030.00718.63
8.0.270.0070.00017.27
8.0.260.0030.00316.75
8.0.250.0060.00316.98
8.0.240.0000.00716.95
8.0.230.0000.01017.00
8.0.220.0060.00316.79
8.0.210.0000.00716.87
8.0.200.0000.00716.91
8.0.190.0030.00516.90
8.0.180.0000.00716.93
8.0.170.0090.00016.93
8.0.160.0030.00416.79
8.0.150.0000.00716.82
8.0.140.0040.00416.71
8.0.130.0030.00613.42
8.0.120.0040.00416.88
8.0.110.0000.00716.79
8.0.100.0040.00416.87
8.0.90.0040.00416.86
8.0.80.0090.00616.89
8.0.70.0000.00816.69
8.0.60.0060.00316.75
8.0.50.0000.00816.96
8.0.30.0090.00916.86
8.0.20.0130.00617.06
8.0.10.0040.00417.09
8.0.00.0090.01216.57
7.4.330.0000.00512.91
7.4.320.0000.00716.53
7.4.300.0070.00016.61
7.4.290.0000.00816.47
7.4.280.0000.00716.49
7.4.270.0030.00716.62
7.4.260.0030.00313.21
7.4.250.0030.00516.43
7.4.240.0030.00316.63
7.4.230.0030.00616.70
7.4.220.0040.01216.50
7.4.210.0030.01016.65
7.4.200.0030.00316.43
7.4.190.0030.00516.47
7.4.160.0100.00716.57
7.4.150.0080.00816.59
7.4.140.0120.00817.86
7.4.130.0080.01116.48
7.4.120.0110.00616.34
7.4.110.0200.00316.54
7.4.100.0190.00316.67
7.4.90.0110.00716.62
7.4.80.0090.00919.39
7.4.70.0120.00616.55
7.4.60.0070.01116.48
7.4.50.0030.00616.52
7.4.40.0070.00716.52
7.4.30.0070.01616.68
7.4.00.0030.01314.83
7.3.330.0030.00513.43
7.3.320.0050.00013.21
7.3.310.0030.00316.46
7.3.300.0060.00016.39
7.3.290.0080.01116.44
7.3.280.0000.01916.41
7.3.270.0090.00816.48
7.3.260.0110.00716.43
7.3.240.0070.01016.36
7.3.230.0130.01016.50
7.3.210.0070.01416.46
7.3.200.0110.00616.37
7.3.190.0170.00016.45
7.3.180.0090.00916.64
7.3.170.0150.00616.52
7.3.160.0140.00716.47
7.3.120.0100.00714.76
7.3.10.0070.00716.65
7.3.00.0030.00716.73
7.2.330.0090.01016.35
7.2.320.0100.00716.66
7.2.310.0110.00816.72
7.2.300.0110.01116.39
7.2.290.0110.00616.50
7.2.130.0160.00016.95
7.2.120.0030.01416.80
7.2.110.0060.00816.88
7.2.100.0030.00616.76
7.2.90.0000.01716.66
7.2.80.0070.00317.00
7.2.70.0060.00917.09
7.2.60.0040.01116.88
7.2.50.0090.00016.88
7.2.40.0110.00316.82
7.2.30.0000.01516.89
7.2.20.0110.00716.64
7.2.10.0090.00317.09
7.2.00.0070.00818.26
7.1.250.0030.01015.70
7.1.70.0000.00817.03
7.1.60.0000.02419.21
7.1.50.0060.01616.92
7.1.00.0030.03722.45
7.0.200.0000.00816.47
7.0.140.0070.06722.09
7.0.120.0070.07021.95
7.0.60.0230.07719.95
7.0.50.0100.07317.92
7.0.40.0070.05020.26
7.0.30.0370.07020.10
7.0.20.0270.07720.26
7.0.10.0100.08720.25
7.0.00.0000.04320.14
5.6.210.0100.07320.63
5.6.200.0070.07318.19
5.6.190.0100.03720.50
5.6.180.0270.07320.47
5.6.170.0300.05320.51
5.6.160.0100.06720.55
5.6.150.0030.04318.28
5.6.140.0100.04718.18
5.6.130.0000.05318.19
5.6.120.0070.09021.00
5.6.110.0070.08021.13
5.6.100.0130.07720.99
5.6.90.0100.07721.02
5.6.80.0170.06720.29
5.5.350.0330.07020.45
5.5.340.0070.07017.98
5.5.330.0030.04020.27
5.5.320.0270.04020.30
5.5.310.0300.07320.25
5.5.300.0130.07718.07
5.5.290.0170.07317.92
5.5.280.0100.08320.77
5.5.270.0070.07320.76
5.5.260.0030.06020.98
5.5.250.0070.08020.47
5.5.240.0170.03720.29
5.4.450.0070.04319.48
5.4.440.0000.04319.40
5.4.430.0030.03719.34
5.4.420.0100.03019.47
5.4.410.0030.03719.07
5.4.400.0170.02319.23
5.4.390.0000.04319.16
5.4.380.0100.03019.08
5.4.370.0030.03719.24
5.4.360.0000.04018.87
5.4.350.0000.04018.87
5.4.340.0070.03318.85
5.4.320.0030.04019.21
5.4.310.0100.03718.92
5.4.300.0000.07718.85
5.4.290.0000.04018.84
5.4.280.0030.04319.14
5.4.270.0130.07019.24
5.4.260.0000.06718.85
5.4.250.0070.07319.20
5.4.240.0070.07318.84
5.4.230.0130.07319.07
5.4.220.0100.06719.14
5.4.210.0130.05719.24
5.4.200.0030.05018.96
5.4.190.0130.04319.23
5.4.180.0100.06018.84
5.4.170.0070.06719.07
5.4.160.0130.07019.09
5.4.150.0000.07019.21
5.4.140.0030.06316.38
5.4.130.0070.06716.23
5.4.120.0100.07016.33
5.4.110.0100.06716.37
5.4.100.0100.06016.43
5.4.90.0130.06316.67
5.4.80.0070.07316.64
5.4.70.0130.06016.29
5.4.60.0130.06716.35
5.4.50.0070.07016.39
5.4.40.0070.07316.42
5.4.30.0000.06016.26
5.4.20.0070.03316.46
5.4.10.0100.07016.46
5.4.00.0100.07015.82
5.3.290.0000.04014.84
5.3.280.0070.08014.65
5.3.270.0070.07314.65
5.3.260.0100.03714.62
5.3.250.0000.04314.64
5.3.240.0000.04714.50
5.3.230.0070.05314.60
5.3.220.0000.04714.57
5.3.210.0030.04714.64
5.3.200.0200.03314.64
5.3.190.0000.08014.57
5.3.180.0030.03714.71
5.3.170.0070.07314.58
5.3.160.0100.04014.59
5.3.150.0170.05714.63
5.3.140.0100.06314.55
5.3.130.0100.04314.71
5.3.120.0100.07714.62
5.3.110.0070.06014.55
5.3.100.0030.06014.19
5.3.90.0030.03714.02
5.3.80.0070.03714.02
5.3.70.0100.04713.97
5.3.60.0030.07714.00
5.3.50.0100.06313.96
5.3.40.0030.06313.95
5.3.30.0000.04013.96
5.3.20.0130.07013.75
5.3.10.0000.05013.80
5.3.00.0030.04013.56
5.2.170.0100.03311.11
5.2.160.0070.04711.04
5.2.150.0030.03711.04
5.2.140.0030.03011.15
5.2.130.0030.03711.02
5.2.120.0000.05311.27
5.2.110.0000.05311.18
5.2.100.0070.04711.05
5.2.90.0070.05311.07
5.2.80.0030.03311.25
5.2.70.0070.06311.05
5.2.60.0100.05311.02
5.2.50.0030.06010.90
5.2.40.0100.04311.00
5.2.30.0070.05710.89
5.2.20.0000.05311.03
5.2.10.0130.02710.93
5.2.00.0030.03310.86
5.1.60.0030.02710.02
5.1.50.0000.0479.93
5.1.40.0030.03710.03
5.1.30.0000.06010.50
5.1.20.0000.04310.36
5.1.10.0030.05310.07
5.1.00.0030.05710.07
5.0.50.0030.0478.57
5.0.40.0030.0408.39
5.0.30.0070.0608.37
5.0.20.0000.0238.37
5.0.10.0030.0478.37
5.0.00.0030.0678.37
4.4.90.0030.0378.37
4.4.80.0030.0338.37
4.4.70.0030.0308.37
4.4.60.0000.0308.37
4.4.50.0030.0208.37
4.4.40.0030.0538.37
4.4.30.0030.0308.37
4.4.20.0000.0378.37
4.4.10.0000.0208.37
4.4.00.0000.0578.37
4.3.110.0030.0378.37
4.3.100.0000.0338.37
4.3.90.0070.0178.37
4.3.80.0070.0408.37
4.3.70.0000.0238.37
4.3.60.0070.0138.37
4.3.50.0000.0408.37
4.3.40.0070.0478.37
4.3.30.0000.0338.37
4.3.20.0000.0208.37
4.3.10.0000.0178.37
4.3.00.0000.0378.37

preferences:
52.86 ms | 401 KiB | 5 Q