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 var_dump($item); $current = $item; do { $current = $current->getParent(); if ($current->getParent() === null) { $current = 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.0120.00918.43
8.3.50.0090.00722.06
8.3.40.0060.01018.94
8.3.30.0060.00919.18
8.3.20.0080.00020.38
8.3.10.0000.00821.98
8.3.00.0080.00022.40
8.2.180.0150.00916.48
8.2.170.0140.00022.96
8.2.160.0140.00019.02
8.2.150.0050.00324.18
8.2.140.0000.00824.66
8.2.130.0000.00826.16
8.2.120.0080.00019.36
8.2.110.0060.00322.07
8.2.100.0090.00318.93
8.2.90.0000.01017.50
8.2.80.0000.00917.97
8.2.70.0080.00017.93
8.2.60.0030.00617.97
8.2.50.0000.00819.39
8.2.40.0000.00819.38
8.2.30.0040.00420.51
8.2.20.0040.00417.73
8.2.10.0050.00317.70
8.2.00.0000.00817.73
8.1.280.0060.00925.92
8.1.270.0040.00422.18
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0040.01422.21
8.1.230.0050.00519.09
8.1.220.0050.00317.74
8.1.210.0080.00018.77
8.1.200.0040.00817.36
8.1.190.0030.00518.93
8.1.180.0000.00818.10
8.1.170.0000.00818.47
8.1.160.0060.00318.86
8.1.150.0000.00818.50
8.1.140.0080.00017.41
8.1.130.0070.00017.91
8.1.120.0080.00017.41
8.1.110.0050.00217.34
8.1.100.0000.00717.42
8.1.90.0000.00717.26
8.1.80.0040.00317.46
8.1.70.0040.00417.30
8.1.60.0030.00617.58
8.1.50.0000.00817.54
8.1.40.0030.00617.52
8.1.30.0000.00717.64
8.1.20.0000.00817.60
8.1.10.0030.00617.54
8.1.00.0070.00017.35
8.0.300.0070.00019.78
8.0.290.0030.00516.63
8.0.280.0000.00818.35
8.0.270.0040.00417.28
8.0.260.0000.00616.82
8.0.250.0000.00716.97
8.0.240.0030.00317.00
8.0.230.0000.00716.96
8.0.220.0040.00416.81
8.0.210.0030.00316.79
8.0.200.0030.00516.97
8.0.190.0080.00016.83
8.0.180.0000.00816.94
8.0.170.0070.00016.89
8.0.160.0030.00616.77
8.0.150.0040.00416.91
8.0.140.0070.00016.76
8.0.130.0060.00013.39
8.0.120.0000.00816.75
8.0.110.0040.00416.91
8.0.100.0020.00516.91
8.0.90.0050.00316.93
8.0.80.0080.01216.91
8.0.70.0050.00316.77
8.0.60.0000.00716.73
8.0.50.0000.00716.89
8.0.30.0100.01017.00
8.0.20.0120.00717.40
8.0.10.0000.00816.86
8.0.00.0110.01016.79
7.4.330.0070.00015.00
7.4.320.0000.00716.52
7.4.300.0030.00316.51
7.4.290.0070.00016.64
7.4.280.0030.00516.43
7.4.270.0040.00416.63
7.4.260.0030.00316.40
7.4.250.0040.00416.39
7.4.240.0060.00216.52
7.4.230.0030.00316.35
7.4.220.0180.00016.57
7.4.210.0070.00816.57
7.4.200.0000.00716.33
7.4.190.0000.00716.65
7.4.160.0090.01516.61
7.4.150.0120.01217.40
7.4.140.0140.00817.86
7.4.130.0110.00716.55
7.4.120.0070.01016.66
7.4.110.0140.00316.67
7.4.100.0140.01116.38
7.4.90.0100.00716.63
7.4.80.0130.01019.39
7.4.70.0030.01316.40
7.4.60.0130.00316.25
7.4.50.0050.00316.50
7.4.40.0080.00422.77
7.4.30.0060.01016.37
7.4.00.0100.00714.89
7.3.330.0020.00213.36
7.3.320.0000.00513.45
7.3.310.0040.00416.33
7.3.300.0030.00316.40
7.3.290.0120.00316.47
7.3.280.0070.00916.40
7.3.270.0110.00617.40
7.3.260.0090.00916.39
7.3.250.0060.01416.37
7.3.240.0040.01916.61
7.3.230.0090.01216.39
7.3.210.0120.00616.50
7.3.200.0040.01319.39
7.3.190.0160.00616.37
7.3.180.0100.01316.39
7.3.170.0060.01016.30
7.3.160.0140.00616.57
7.3.120.0120.00314.98
7.3.10.0120.00016.65
7.3.00.0040.01116.46
7.2.330.0120.00616.42
7.2.320.0090.01316.55
7.2.310.0160.00316.29
7.2.300.0100.00616.46
7.2.290.0160.00016.34
7.2.130.0000.01416.91
7.2.120.0070.00716.91
7.2.110.0060.00916.76
7.2.100.0000.01316.52
7.2.90.0030.01216.95
7.2.80.0060.00916.64
7.2.70.0060.00916.62
7.2.60.0170.00016.88
7.2.50.0090.00916.83
7.2.40.0070.00716.97
7.2.30.0070.00716.90
7.2.20.0030.01416.84
7.2.10.0000.01416.97
7.2.00.0050.01018.21
7.1.250.0030.01315.75
7.1.240.0130.00315.87
7.1.230.0090.00015.78
7.1.220.0070.01015.46
7.1.210.0070.01015.67
7.1.200.0000.00815.82
7.1.190.0070.00315.89
7.1.180.0030.01015.82
7.1.170.0150.00315.76
7.1.160.0070.00715.90
7.1.150.0030.01015.76
7.1.140.0030.00915.89
7.1.130.0090.00315.91
7.1.120.0070.00715.66
7.1.110.0150.00315.89
7.1.100.0070.00716.79
7.1.90.0060.00615.49
7.1.80.0040.00815.61
7.1.70.0020.01316.46
7.1.60.0060.01517.89
7.1.50.0040.01416.32
7.1.40.0070.00715.85
7.1.30.0090.00615.43
7.1.20.0030.01415.59
7.1.10.0050.00515.64
7.1.00.0020.04418.96
7.0.330.0000.00815.01
7.0.320.0060.01015.02
7.0.310.0030.00615.33
7.0.300.0030.00615.21
7.0.290.0000.01415.54
7.0.280.0040.00415.37
7.0.270.0040.00915.48
7.0.260.0100.00314.93
7.0.250.0000.00715.01
7.0.240.0070.00315.41
7.0.230.0130.00315.27
7.0.220.0070.00315.40
7.0.210.0030.00615.32
7.0.200.0030.00615.99
7.0.190.0110.00715.29
7.0.180.0090.00315.01
7.0.170.0030.00615.24
7.0.160.0070.00715.22
7.0.150.0110.00015.46
7.0.140.0060.03618.70
7.0.130.0120.00615.42
7.0.120.0000.00915.01
7.0.110.0080.00015.52
7.0.100.0110.00415.32
7.0.90.0310.04417.45
7.0.80.0250.04617.67
7.0.70.0250.03217.65
7.0.60.0270.04717.66
7.0.50.0310.02817.90
7.0.40.0070.02716.75
7.0.30.0090.02416.70
7.0.20.0140.02016.74
7.0.10.0050.03016.66
7.0.00.0070.04816.80
5.6.380.0080.00014.52
5.6.370.0060.00614.19
5.6.360.0030.01014.60
5.6.350.0040.00914.46
5.6.340.0070.00714.53
5.6.330.0060.00614.19
5.6.320.0000.01314.66
5.6.310.0040.01114.24
5.6.300.0060.00614.39
5.6.290.0040.00414.33
5.6.280.0060.03517.87
5.6.270.0030.01014.16
5.6.260.0070.00714.62
5.6.250.0040.01214.04
5.6.240.0070.00714.18
5.6.230.0070.04317.37
5.6.220.0050.02917.37
5.6.210.0070.03017.38
5.6.200.0050.03417.59
5.6.190.0140.04217.65
5.6.180.0080.03017.57
5.6.170.0070.02517.64
5.6.160.0080.04317.67
5.6.150.0070.02517.60
5.6.140.0060.04617.80
5.6.130.0030.05117.83
5.6.120.0130.03517.78
5.6.110.0060.04117.69
5.6.100.0100.04017.72
5.6.90.0080.02817.68
5.6.80.0000.05017.43
5.6.70.0050.04517.30
5.6.60.0120.04217.33
5.6.50.0100.03817.35
5.6.40.0050.03517.37
5.6.30.0070.04217.43
5.6.20.0070.02817.42
5.6.10.0120.03517.30
5.6.00.0080.04517.34
5.5.380.0030.00311.00
5.5.370.0070.04215.78
5.5.360.0020.02915.74
5.5.350.0100.02215.80
5.5.340.0070.02215.92
5.5.330.0090.04116.12
5.5.320.0020.02615.91
5.5.310.0080.02216.04
5.5.300.0070.04015.94
5.5.290.0100.02515.92
5.5.280.0070.04515.98
5.5.270.0100.03915.92
5.5.260.0060.04516.08
5.5.250.0160.03015.75
5.5.240.0030.04415.51
5.5.230.0100.04015.66
5.5.220.0070.03815.75
5.5.210.0070.04415.69
5.5.200.0080.04115.62
5.5.190.0080.02815.75
5.5.180.0070.04215.62
5.5.170.0000.00811.10
5.5.160.0080.03315.57
5.5.150.0110.02015.59
5.5.140.0080.04215.50
5.5.130.0080.02515.51
5.5.120.0080.02015.62
5.5.110.0050.03015.67
5.5.100.0000.04315.54
5.5.90.0060.03315.52
5.5.80.0070.04215.67
5.5.70.0060.04115.55
5.5.60.0030.02315.50
5.5.50.0070.04015.58
5.5.40.0070.02715.37
5.5.30.0030.04415.57
5.5.20.0060.02215.37
5.5.10.0050.03815.68
5.5.00.0030.04515.61
5.4.450.0030.04315.18
5.4.440.0060.04415.22
5.4.430.0050.04015.22
5.4.420.0090.03515.07
5.4.410.0030.03815.13
5.4.400.0070.03314.96
5.4.390.0050.04315.02
5.4.380.0070.03814.94
5.4.370.0080.04015.10
5.4.360.0080.02515.02
5.4.350.0070.02715.00
5.4.340.0070.04114.98
5.4.330.0050.00510.66
5.4.320.0050.03814.97
5.4.310.0070.03914.97
5.4.300.0070.04014.92
5.4.290.0050.04015.06
5.4.280.0100.03215.10
5.4.270.0090.03615.07
5.4.260.0120.04014.89
5.4.250.0070.03714.91
5.4.240.0050.02614.68
5.4.230.0020.02414.93
5.4.220.0050.02214.90
5.4.210.0030.03714.97
5.4.200.0040.02415.09
5.4.190.0040.02414.97
5.4.180.0030.03515.01
5.4.170.0020.04314.99
5.4.160.0100.03715.03
5.4.150.0050.03714.85
5.4.140.0000.03113.74
5.4.130.0020.02413.49
5.4.120.0030.02013.61
5.4.110.0050.03813.56
5.4.100.0070.04013.87
5.4.90.0050.02913.73
5.4.80.0070.03813.70
5.4.70.0020.03013.82
5.4.60.0160.03313.75
5.4.50.0060.03313.75
5.4.40.0020.02713.85
5.4.30.0070.03013.53
5.4.20.0050.03513.71
5.4.10.0050.03913.69
5.4.00.0060.03513.26
5.3.290.0020.03012.71
5.3.280.0030.04312.59
5.3.270.0060.04312.61
5.3.260.0050.03812.69
5.3.250.0050.04512.75
5.3.240.0090.03512.60
5.3.230.0030.02512.71
5.3.220.0070.02512.52
5.3.210.0030.02212.45
5.3.200.0050.03012.58
5.3.190.0080.03012.55
5.3.180.0030.03512.58
5.3.170.0070.03712.71
5.3.160.0030.02712.63
5.3.150.0060.04012.56
5.3.140.0050.02912.59
5.3.130.0000.03512.58
5.3.120.0030.03512.57
5.3.110.0080.03012.46
5.3.100.0050.04112.24
5.3.90.0070.02012.26
5.3.80.0030.04212.31
5.3.70.0050.02512.33
5.3.60.0030.02512.38
5.3.50.0030.02712.29
5.3.40.0030.04212.23
5.3.30.0100.03712.10
5.3.20.0070.03212.12
5.3.10.0030.03012.13
5.3.00.0000.02711.94
5.2.170.0020.03611.89
5.2.160.0050.02811.89
5.2.150.0070.03011.89
5.2.140.0050.03311.89
5.2.130.0030.03311.89
5.2.120.0060.03011.89
5.2.110.0010.01911.89
5.2.100.0040.02111.89
5.2.90.0050.02811.89
5.2.80.0080.03011.89
5.2.70.0070.03211.89
5.2.60.0020.02211.89
5.2.50.0060.01811.89
5.2.40.0060.02711.89
5.2.30.0040.02211.89
5.2.20.0070.03411.89
5.2.10.0070.02211.89
5.2.00.0060.01811.89
5.1.60.0050.02711.89
5.1.50.0050.01811.89
5.1.40.0070.02311.89
5.1.30.0050.03011.89
5.1.20.0080.02511.89
5.1.10.0060.02811.89
5.1.00.0030.02411.89
5.0.50.0040.02711.89
5.0.40.0050.01511.89
5.0.30.0020.03611.89
5.0.20.0080.01011.89
5.0.10.0040.01511.89
5.0.00.0080.02111.89
4.4.90.0000.01211.89
4.4.80.0020.01511.89
4.4.70.0000.01911.89
4.4.60.0030.01811.89
4.4.50.0000.01711.89
4.4.40.0020.03211.89
4.4.30.0000.01511.89
4.4.20.0040.01711.89
4.4.10.0020.01311.89
4.4.00.0030.01811.89
4.3.110.0040.01711.89
4.3.100.0050.01011.89
4.3.90.0000.01511.89
4.3.80.0030.02111.89
4.3.70.0020.01911.89
4.3.60.0020.01511.89
4.3.50.0030.01311.89
4.3.40.0020.01811.89
4.3.30.0000.01611.89
4.3.20.0030.01211.89
4.3.10.0020.01211.89
4.3.00.0020.01311.89

preferences:
61.19 ms | 400 KiB | 5 Q