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 do { $item =& $item->getParent(); if ($item->getParent() === null) { $item = new Item(); break; } } while (true); 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.60.0040.01116.63
8.3.50.0080.01017.44
8.3.40.0100.00718.88
8.3.30.0140.00018.59
8.3.20.0050.00318.73
8.3.10.0040.01120.48
8.3.00.0000.00919.20
8.2.180.0140.00716.63
8.2.170.0120.00922.96
8.2.160.0100.00321.02
8.2.150.0070.00024.18
8.2.140.0030.00524.66
8.2.130.0070.00726.16
8.2.120.0030.00621.05
8.2.110.0070.00321.07
8.2.100.0080.00417.85
8.2.90.0000.00920.78
8.2.80.0040.00417.80
8.2.70.0040.00417.63
8.2.60.0080.00017.91
8.2.50.0030.00618.07
8.2.40.0000.00818.16
8.2.30.0000.00818.06
8.2.20.0050.00217.63
8.2.10.0050.00217.55
8.2.00.0040.00417.56
8.1.280.0040.01125.92
8.1.270.0070.00024.66
8.1.260.0050.00326.35
8.1.250.0040.00428.09
8.1.240.0000.01022.34
8.1.230.0060.00620.92
8.1.220.0000.00817.74
8.1.210.0040.00418.89
8.1.200.0040.00417.23
8.1.190.0040.00417.52
8.1.180.0000.00918.10
8.1.170.0000.00818.84
8.1.160.0070.00018.75
8.1.150.0040.00418.63
8.1.140.0000.00717.27
8.1.130.0030.00317.82
8.1.120.0000.00917.43
8.1.110.0000.00817.45
8.1.100.0000.00817.30
8.1.90.0040.00417.28
8.1.80.0050.00217.41
8.1.70.0000.00717.35
8.1.60.0080.00017.59
8.1.50.0000.00817.50
8.1.40.0050.00317.55
8.1.30.0040.00417.64
8.1.20.0040.00417.56
8.1.10.0050.00317.41
8.1.00.0100.00317.44
8.0.300.0030.00619.87
8.0.290.0080.00016.63
8.0.280.0070.00018.40
8.0.270.0030.00317.18
8.0.260.0070.00016.80
8.0.250.0040.00416.97
8.0.240.0000.00716.84
8.0.230.0000.00716.99
8.0.220.0000.00816.95
8.0.210.0080.00016.89
8.0.200.0060.00017.00
8.0.190.0040.00416.96
8.0.180.0030.00516.86
8.0.170.0030.00616.80
8.0.160.0030.00316.96
8.0.150.0080.00016.87
8.0.140.0110.00016.75
8.0.130.0030.00313.30
8.0.120.0040.00416.73
8.0.110.0070.00016.71
8.0.100.0050.00216.81
8.0.90.0070.00016.82
8.0.80.0090.00616.91
8.0.70.0040.00416.84
8.0.60.0000.00716.75
8.0.50.0000.00716.71
8.0.30.0130.01017.09
8.0.20.0150.01017.00
8.0.10.0050.00316.92
8.0.00.0090.00816.78
7.4.330.0050.00012.98
7.4.320.0030.00316.56
7.4.300.0000.00716.59
7.4.290.0000.00716.57
7.4.280.0000.00816.50
7.4.270.0040.00416.61
7.4.260.0030.00313.20
7.4.250.0000.00916.48
7.4.240.0030.00316.50
7.4.230.0030.00316.41
7.4.220.0190.00616.46
7.4.210.0100.00716.61
7.4.200.0050.00316.59
7.4.190.0000.00716.41
7.4.160.0110.00516.31
7.4.150.0070.01016.75
7.4.140.0060.01116.48
7.4.130.0080.01216.45
7.4.120.0110.01016.60
7.4.110.0140.00316.65
7.4.100.0080.00816.70
7.4.90.0040.01516.52
7.4.80.0060.01216.45
7.4.70.0070.01016.77
7.4.60.0120.00616.56
7.4.50.0000.00716.11
7.4.40.0090.00616.66
7.4.30.0130.01016.49
7.4.00.0040.01414.59
7.3.330.0030.00313.14
7.3.320.0060.00013.37
7.3.310.0000.00716.38
7.3.300.0020.00516.36
7.3.290.0120.00316.25
7.3.280.0110.01016.40
7.3.270.0060.01316.31
7.3.260.0090.01016.42
7.3.250.0140.00316.36
7.3.240.0130.00316.48
7.3.230.0060.00916.39
7.3.210.0080.01216.30
7.3.200.0090.00919.39
7.3.190.0090.00916.45
7.3.180.0100.00616.45
7.3.170.0150.00416.32
7.3.160.0070.01016.38
7.3.120.0060.01014.80
7.2.330.0060.01216.61
7.2.320.0110.00616.69
7.2.310.0100.01416.47
7.2.300.0060.01016.68
7.2.290.0060.01216.46
7.2.60.0070.00316.71
7.2.00.0030.01219.44
7.1.200.0030.01015.57
7.1.100.0150.00617.86
7.1.70.0050.00317.26
7.1.60.0110.01419.40
7.1.50.0030.01716.96
7.1.00.0100.03322.48
7.0.200.0110.00315.18
7.0.140.0000.07722.15
7.0.120.0070.05322.04
7.0.60.0030.07019.85
7.0.50.0100.07018.00
7.0.40.0100.04320.10
7.0.30.0330.09020.33
7.0.20.0230.08020.45
7.0.10.0030.04320.25
7.0.00.0030.06020.20
5.6.280.0030.07321.03
5.6.210.0170.06020.55
5.6.200.0130.07718.13
5.6.190.0070.04720.64
5.6.180.0570.06720.43
5.6.170.0500.05320.47
5.6.160.0200.05020.54
5.6.150.0070.08018.14
5.6.140.0070.07018.18
5.6.130.0070.08018.27
5.6.120.0130.06721.13
5.6.110.0070.07321.14
5.6.100.0000.07320.98
5.6.90.0130.07720.97
5.6.80.0070.05320.39
5.5.350.0230.07720.34
5.5.340.0100.03717.97
5.5.330.0030.06720.21
5.5.320.0300.04320.34
5.5.310.0230.03720.31
5.5.300.0030.06017.98
5.5.290.0030.05317.92
5.5.280.0030.04020.62
5.5.270.0070.08020.86
5.5.260.0030.04020.68
5.5.250.0030.06020.47
5.5.240.0000.08720.33
5.4.450.0070.03719.44
5.4.440.0030.04019.56
5.4.430.0030.03719.17
5.4.420.0130.03019.40
5.4.410.0100.03319.07
5.4.400.0030.04019.16
5.4.390.0070.03319.00
5.4.380.0030.03719.14
5.4.370.0070.04018.85
5.4.360.0100.07318.86
5.4.350.0070.04719.15
5.4.340.0100.06319.24
5.4.320.0100.07319.10
5.4.310.0070.06319.24
5.4.300.0130.04319.26
5.4.290.0000.06019.12
5.4.280.0100.06719.24
5.4.270.0030.07019.11
5.4.260.0170.04019.00
5.4.250.0030.04019.23
5.4.240.0030.05718.84
5.4.230.0070.07719.20
5.4.220.0070.07719.11
5.4.210.0030.05019.20
5.4.200.0070.03318.97
5.4.190.0070.07318.91
5.4.180.0030.07319.07
5.4.170.0100.06719.13
5.4.160.0070.06019.09
5.4.150.0070.07719.05
5.4.140.0130.05716.43
5.4.130.0230.05016.34
5.4.120.0030.03716.27
5.4.110.0100.07316.30
5.4.100.0000.08016.28
5.4.90.0030.05016.68
5.4.80.0000.05316.41
5.4.70.0100.03316.45
5.4.60.0030.03716.43
5.4.50.0000.04716.44
5.4.40.0000.04316.40
5.4.30.0000.04716.48
5.4.20.0030.07316.44
5.4.10.0130.06316.38
5.4.00.0030.07315.99
5.3.290.0130.06014.68
5.3.280.0070.03714.60
5.3.270.0130.07014.66
5.3.260.0030.05714.64
5.3.250.0100.05714.60
5.3.240.0070.07014.64
5.3.230.0000.05014.61
5.3.220.0100.06714.59
5.3.210.0100.04314.46
5.3.200.0100.07314.61
5.3.190.0130.07014.46
5.3.180.0030.07714.60
5.3.170.0030.06014.62
5.3.160.0000.04314.59
5.3.150.0070.03714.60
5.3.140.0070.04014.71
5.3.130.0130.06714.57
5.3.120.0100.07714.59
5.3.110.0100.07714.57
5.3.100.0070.06714.06
5.3.90.0070.06314.09
5.3.80.0130.06714.07
5.3.70.0130.04314.03
5.3.60.0170.06314.05
5.3.50.0070.04713.90
5.3.40.0130.03014.11
5.3.30.0130.02713.96
5.3.20.0070.05313.73
5.3.10.0030.04713.70
5.3.00.0130.08013.79
5.2.170.0070.03311.12
5.2.160.0000.04311.11
5.2.150.0100.02311.32
5.2.140.0100.06011.10
5.2.130.0000.03711.16
5.2.120.0100.05011.19
5.2.110.0070.03311.11
5.2.100.0170.05711.25
5.2.90.0030.04711.11
5.2.80.0030.06011.17
5.2.70.0000.04711.13
5.2.60.0000.03311.05
5.2.50.0030.03010.97
5.2.40.0000.03710.95
5.2.30.0030.04710.97
5.2.20.0030.03010.93
5.2.10.0100.02311.00
5.2.00.0100.05710.61
5.1.60.0030.0239.97
5.1.50.0030.04710.15
5.1.40.0070.0539.97
5.1.30.0100.03010.26
5.1.20.0030.04310.37
5.1.10.0030.03310.12
5.1.00.0000.04710.07
5.0.50.0070.0238.54
5.0.40.0000.0308.32
5.0.30.0000.0678.07
5.0.20.0030.0238.08
5.0.10.0070.0338.01
5.0.00.0030.0378.02
4.4.90.0030.0177.84
4.4.80.0000.0237.84
4.4.70.0000.0377.84
4.4.60.0070.0207.84
4.4.50.0030.0137.84
4.4.40.0000.0537.84
4.4.30.0000.0207.84
4.4.20.0100.0107.84
4.4.10.0070.0177.84
4.4.00.0000.0277.84
4.3.110.0030.0177.84
4.3.100.0000.0277.84
4.3.90.0030.0307.84
4.3.80.0070.0207.84
4.3.70.0000.0237.84
4.3.60.0000.0237.84
4.3.50.0070.0337.84
4.3.40.0030.0407.84
4.3.30.0030.0277.84
4.3.20.0070.0307.84
4.3.10.0030.0337.84
4.3.00.0000.0207.84

preferences:
33.72 ms | 401 KiB | 5 Q