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 $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 =& Item::newWithParent($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.0130.01016.49
8.3.50.0090.01117.42
8.3.40.0040.01118.98
8.3.30.0090.00618.54
8.3.20.0040.00418.77
8.3.10.0040.00418.90
8.3.00.0030.00519.38
8.2.180.0080.00816.74
8.2.170.0070.00722.96
8.2.160.0150.00021.06
8.2.150.0050.00324.18
8.2.140.0000.00824.66
8.2.130.0000.00826.16
8.2.120.0110.00418.97
8.2.110.0060.00320.33
8.2.100.0040.00817.78
8.2.90.0000.00819.05
8.2.80.0000.00919.38
8.2.70.0080.00017.50
8.2.60.0000.00917.93
8.2.50.0000.00818.07
8.2.40.0000.00818.09
8.2.30.0040.00418.07
8.2.20.0000.01019.49
8.2.10.0040.00417.66
8.2.00.0000.00717.65
8.1.280.0140.00025.92
8.1.270.0040.00423.99
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0100.00321.83
8.1.230.0090.00320.91
8.1.220.0000.00818.77
8.1.210.0050.00319.10
8.1.200.0030.00617.35
8.1.190.0000.00717.39
8.1.180.0000.00918.10
8.1.170.0070.00018.79
8.1.160.0000.00718.88
8.1.150.0040.00418.59
8.1.140.0040.00417.38
8.1.130.0030.00317.83
8.1.120.0030.00717.48
8.1.110.0050.00317.40
8.1.100.0000.00717.30
8.1.90.0040.00417.42
8.1.80.0040.00317.28
8.1.70.0050.00317.43
8.1.60.0060.00317.62
8.1.50.0040.00417.54
8.1.40.0080.00017.39
8.1.30.0080.00017.56
8.1.20.0000.00717.69
8.1.10.0000.00817.63
8.1.00.0050.00517.41
8.0.300.0000.00819.94
8.0.290.0040.00416.75
8.0.280.0050.00218.31
8.0.270.0000.00717.08
8.0.260.0070.00016.76
8.0.250.0040.00416.96
8.0.240.0040.00416.92
8.0.230.0000.00717.03
8.0.220.0000.00716.91
8.0.210.0030.00316.95
8.0.200.0000.00716.97
8.0.190.0000.00816.88
8.0.180.0000.00816.94
8.0.170.0030.00616.93
8.0.160.0030.00516.86
8.0.150.0070.00416.85
8.0.140.0050.00216.76
8.0.130.0000.00613.30
8.0.120.0000.00816.85
8.0.110.0040.00416.86
8.0.100.0040.00416.92
8.0.90.0050.00316.82
8.0.80.0100.00316.85
8.0.70.0000.00916.84
8.0.60.0000.00716.75
8.0.50.0070.00016.79
8.0.30.0090.00917.00
8.0.20.0220.01117.16
8.0.10.0030.00616.99
8.0.00.0140.00516.62
7.4.330.0000.00613.00
7.4.320.0030.00316.56
7.4.300.0030.00316.66
7.4.290.0000.00716.67
7.4.280.0040.00416.53
7.4.270.0030.00316.67
7.4.260.0000.00513.33
7.4.250.0040.00416.64
7.4.240.0030.00316.53
7.4.230.0040.00416.55
7.4.220.0070.01316.67
7.4.210.0040.01016.55
7.4.200.0030.00316.45
7.4.190.0000.00716.54
7.4.160.0160.00616.52
7.4.150.0140.00316.46
7.4.140.0150.00416.57
7.4.130.0140.00716.51
7.4.120.0080.00816.50
7.4.110.0090.00916.45
7.4.100.0120.00616.38
7.4.90.0130.00416.48
7.4.80.0060.01219.39
7.4.70.0100.01016.60
7.4.60.0030.01316.44
7.4.50.0040.00416.37
7.4.40.0090.00616.18
7.4.30.0120.00316.45
7.4.00.0040.01114.80
7.3.330.0030.00313.24
7.3.320.0030.00313.32
7.3.310.0030.00316.35
7.3.300.0000.00716.38
7.3.290.0110.00416.32
7.3.280.0070.00916.35
7.3.270.0130.00316.37
7.3.260.0160.01016.52
7.3.250.0100.00816.42
7.3.240.0090.00916.41
7.3.230.0110.00816.45
7.3.210.0100.00716.62
7.3.200.0070.00916.36
7.3.190.0100.00616.25
7.3.180.0090.00616.36
7.3.170.0110.00716.67
7.3.160.0070.01416.48
7.3.120.0060.01015.03
7.3.110.0070.01014.75
7.3.100.0070.00714.83
7.3.90.0060.00814.96
7.3.80.0100.00714.72
7.3.70.0100.00314.86
7.3.60.0070.00714.84
7.3.50.0080.00714.70
7.3.40.0000.01714.63
7.3.30.0040.00814.86
7.3.20.0030.01016.55
7.3.10.0030.00516.41
7.3.00.0070.00316.72
7.2.330.0070.01016.72
7.2.320.0060.01516.65
7.2.310.0030.01516.53
7.2.300.0090.00916.49
7.2.290.0110.00716.66
7.2.240.0060.00714.79
7.2.230.0030.01314.97
7.2.220.0070.01014.86
7.2.210.0060.00914.90
7.2.200.0000.00914.75
7.2.190.0070.00414.84
7.2.180.0070.01014.83
7.2.170.0030.01414.98
7.2.160.0040.00415.16
7.2.150.0030.01316.96
7.2.140.0040.00716.89
7.2.130.0070.00716.91
7.2.120.0090.00616.59
7.2.110.0040.00716.82
7.2.100.0060.00316.78
7.2.90.0030.00917.03
7.2.80.0070.00716.83
7.2.70.0070.00716.89
7.2.60.0030.01116.86
7.2.50.0070.00716.84
7.2.40.0000.01416.74
7.2.30.0110.00016.98
7.2.20.0060.00317.07
7.2.10.0120.00316.98
7.2.00.0030.00918.18
7.1.330.0070.00715.81
7.1.320.0030.01315.47
7.1.310.0030.00915.75
7.1.300.0060.00915.45
7.1.290.0070.01015.50
7.1.280.0060.01015.63
7.1.270.0100.00315.58
7.1.260.0000.01115.59
7.1.250.0070.00315.71
7.1.200.0070.00415.47
7.1.100.0000.01118.23
7.1.70.0030.00517.16
7.1.60.0120.00919.40
7.1.50.0190.00934.61
7.1.00.0000.08022.32
7.0.200.0260.00714.88
7.0.140.0100.06722.00
7.0.120.0030.06322.16
7.0.60.0100.05721.82
7.0.50.0170.07317.95
7.0.40.0030.08320.02
7.0.30.0200.04020.06
7.0.20.0400.06320.27
7.0.10.0070.04020.20
7.0.00.0030.05020.20
5.6.210.0100.03320.72
5.6.200.0070.06718.15
5.6.190.0100.08020.56
5.6.180.0230.05020.57
5.6.170.0270.05720.71
5.6.160.0070.05720.71
5.6.150.0130.04718.18
5.6.140.0030.08018.15
5.6.130.0070.06718.25
5.6.120.0100.08321.16
5.6.110.0070.05321.00
5.6.100.0130.08021.14
5.6.90.0130.07720.85
5.6.80.0100.05020.31
5.5.350.0230.05320.31
5.5.340.0070.08318.04
5.5.330.0100.05020.28
5.5.320.0330.06320.25
5.5.310.0200.08320.35
5.5.300.0030.05017.97
5.5.290.0170.07718.05
5.5.280.0100.07720.80
5.5.270.0070.08020.77
5.5.260.0100.08320.73
5.5.250.0100.07720.58
5.5.240.0300.06320.37
5.4.450.1930.04319.39
5.4.440.1870.03719.41
5.4.430.2000.03719.41
5.4.420.2000.04719.16
5.4.410.2070.04319.41
5.4.400.1770.04319.20
5.4.390.1900.03719.22
5.4.380.2130.04019.32
5.4.370.1870.03719.13
5.4.360.1870.05018.99
5.4.350.1900.04019.00
5.4.340.2070.03319.24
5.4.320.2100.03718.84
5.4.310.2000.04019.15
5.4.300.1870.04018.87
5.4.290.1900.04319.24
5.4.280.2100.03319.19
5.4.270.2170.03318.87
5.4.260.1900.03019.24
5.4.250.1870.03718.99
5.4.240.2200.03718.87
5.4.230.2030.03719.19
5.4.220.2230.04718.86
5.4.210.0130.05719.31
5.4.200.0030.04318.94
5.4.190.0030.04019.05
5.4.180.1070.04019.06
5.4.170.2070.04018.85
5.4.160.2100.03319.14
5.4.150.2130.03719.21
5.4.140.2170.03716.50
5.4.130.2000.03316.49
5.4.120.1800.03716.44
5.4.110.0300.03316.57
5.4.100.0070.04016.19
5.4.90.0200.04716.58
5.4.80.1770.03716.44
5.4.70.1370.03716.44
5.4.60.2170.04716.51
5.4.50.1770.04016.51
5.4.40.1830.03316.52
5.4.30.1670.03716.55
5.4.20.1770.04016.16
5.4.10.1870.03716.32
5.4.00.1900.03315.83
5.3.290.1900.04014.59
5.3.280.1800.04314.59
5.3.270.0200.03714.69
5.3.260.0030.03714.75
5.3.250.0030.03714.58
5.3.240.2370.03714.52
5.3.230.1900.04014.57
5.3.220.1670.04714.79
5.3.210.2170.05714.50
5.3.200.2230.04714.58
5.3.190.2170.05014.59
5.3.180.1930.02714.57
5.3.170.2000.04714.48
5.3.160.2000.04014.54
5.3.150.1670.03314.57
5.3.140.0670.03714.48
5.3.130.0030.03714.51
5.3.120.0000.04014.48
5.3.110.1730.04314.45
5.3.100.2130.04314.03
5.3.90.2000.04313.99
5.3.80.2000.04714.11
5.3.70.1800.03714.04
5.3.60.1770.05014.04
5.3.50.0100.03013.88
5.3.40.0030.04713.93
5.3.30.0070.04713.77
5.3.20.1200.04713.61
5.3.10.2430.04013.77
5.3.00.2000.03713.55
5.2.170.1700.03011.07
5.2.160.2000.03311.07
5.2.150.1670.03311.32
5.2.140.1800.03711.22
5.2.130.1730.02711.04
5.2.120.1700.02711.02
5.2.110.1700.03011.16
5.2.100.1670.03010.97
5.2.90.1930.03011.20
5.2.80.1670.03011.07
5.2.70.1670.03011.13
5.2.60.1730.03311.28
5.2.50.1930.03711.14
5.2.40.1300.03010.98
5.2.30.1370.02711.02
5.2.20.1470.03011.01
5.2.10.1670.02710.95
5.2.00.1400.03310.80
5.1.60.1630.0279.98
5.1.50.1300.0279.89
5.1.40.1300.03010.21
5.1.30.1330.02010.24
5.1.20.1530.03310.31
5.1.10.1530.03010.06
5.1.00.1530.03010.05
5.0.50.0870.0308.60
5.0.40.0830.0278.54
5.0.30.0830.0438.11
5.0.20.0700.0208.43
5.0.10.0870.0278.15
5.0.00.0630.0308.11
4.4.90.0700.0138.11
4.4.80.0730.0138.11
4.4.70.0830.0238.11
4.4.60.0870.0208.11
4.4.50.0800.0238.11
4.4.40.0830.0308.11
4.4.30.0830.0238.11
4.4.20.0800.0238.11
4.4.10.0670.0178.11
4.4.00.0900.0338.11
4.3.110.0770.0178.11
4.3.100.0800.0178.11
4.3.90.0800.0138.11
4.3.80.0770.0408.11
4.3.70.0830.0238.11
4.3.60.0830.0238.11
4.3.50.0870.0238.11
4.3.40.0830.0378.11
4.3.30.0400.0308.11
4.3.20.0430.0338.11
4.3.10.0370.0178.11
4.3.00.0400.0208.11

preferences:
54.05 ms | 401 KiB | 5 Q