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 { $prev = &$item; $item = $item->getParent(); if ($item->getParent() === null) { $prev =& 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.0150.00618.52
8.3.50.0130.00621.99
8.3.40.0000.01418.79
8.3.30.0120.00418.63
8.3.20.0080.00018.77
8.3.10.0080.00021.04
8.3.00.0070.00021.63
8.2.180.0110.00416.63
8.2.170.0090.00622.96
8.2.160.0100.00320.39
8.2.150.0050.00324.18
8.2.140.0000.00824.66
8.2.130.0000.00726.16
8.2.120.0060.00319.66
8.2.110.0060.00322.43
8.2.100.0070.00417.91
8.2.90.0000.00817.63
8.2.80.0050.00517.97
8.2.70.0040.00417.90
8.2.60.0060.00317.93
8.2.50.0000.00818.10
8.2.40.0040.00720.52
8.2.30.0040.00419.33
8.2.20.0070.00417.76
8.2.10.0040.00417.73
8.2.00.0040.00417.71
8.1.280.0170.00325.92
8.1.270.0040.00423.99
8.1.260.0030.01026.35
8.1.250.0030.00628.09
8.1.240.0070.00420.52
8.1.230.0050.00519.03
8.1.220.0030.00517.74
8.1.210.0030.00618.77
8.1.200.0060.00317.23
8.1.190.0090.00017.09
8.1.180.0050.00518.10
8.1.170.0050.00318.54
8.1.160.0050.00318.90
8.1.150.0040.00418.54
8.1.140.0000.00817.39
8.1.130.0030.00317.83
8.1.120.0070.00017.50
8.1.110.0070.00317.40
8.1.100.0000.00717.29
8.1.90.0000.00717.29
8.1.80.0000.00817.41
8.1.70.0000.00717.43
8.1.60.0080.00017.60
8.1.50.0000.00717.49
8.1.40.0030.00517.54
8.1.30.0000.00817.51
8.1.20.0080.00017.71
8.1.10.0000.00817.59
8.1.00.0060.00317.49
8.0.300.0060.00321.57
8.0.290.0000.00816.75
8.0.280.0000.00818.46
8.0.270.0000.00717.25
8.0.260.0030.00316.82
8.0.250.0080.00016.87
8.0.240.0040.00416.90
8.0.230.0040.00416.98
8.0.220.0040.00416.88
8.0.210.0030.00316.94
8.0.200.0000.00717.01
8.0.190.0030.00616.98
8.0.180.0070.00016.82
8.0.170.0070.00016.93
8.0.160.0000.00716.93
8.0.150.0040.00416.91
8.0.140.0040.00416.91
8.0.130.0030.00313.33
8.0.120.0050.00316.88
8.0.110.0040.00416.91
8.0.100.0050.00216.76
8.0.90.0000.00716.81
8.0.80.0060.00916.78
8.0.70.0000.00716.73
8.0.60.0030.00516.97
8.0.50.0000.00816.81
8.0.30.0160.00616.96
8.0.20.0100.00917.40
8.0.10.0000.00816.97
8.0.00.0140.00716.85
7.4.330.0050.00014.65
7.4.320.0000.00716.65
7.4.300.0030.00316.63
7.4.290.0000.00716.42
7.4.280.0080.00016.57
7.4.270.0000.00716.41
7.4.260.0000.00513.18
7.4.250.0040.00416.60
7.4.240.0000.00716.43
7.4.230.0070.00016.41
7.4.220.0060.01316.47
7.4.210.0040.01016.53
7.4.200.0070.00016.41
7.4.190.0000.00716.41
7.4.160.0100.00716.47
7.4.150.0060.01217.40
7.4.140.0050.01317.86
7.4.130.0060.01216.41
7.4.120.0070.00916.71
7.4.110.0140.00316.24
7.4.100.0030.01616.55
7.4.90.0140.00916.51
7.4.80.0040.01419.39
7.4.70.0090.00916.66
7.4.60.0090.01316.55
7.4.50.0030.00516.34
7.4.40.0070.01022.52
7.4.30.0100.00716.61
7.4.00.0170.00014.78
7.3.330.0060.00013.43
7.3.320.0030.00313.23
7.3.310.0000.00716.48
7.3.300.0000.00716.48
7.3.290.0040.01416.42
7.3.280.0100.00616.40
7.3.270.0190.00617.40
7.3.260.0070.01118.24
7.3.250.0100.00916.41
7.3.240.0060.01116.48
7.3.230.0150.00316.57
7.3.210.0060.01216.68
7.3.200.0030.01419.39
7.3.190.0030.01916.45
7.3.180.0060.01016.59
7.3.170.0110.00516.59
7.3.160.0080.00916.42
7.3.120.0030.01314.81
7.3.00.0060.00616.71
7.2.330.0120.00616.58
7.2.320.0140.00416.54
7.2.310.0200.00316.69
7.2.300.0040.01216.68
7.2.290.0060.01316.53
7.2.130.0000.01316.77
7.2.120.0100.00316.68
7.2.110.0000.01216.58
7.2.100.0100.00316.89
7.2.90.0040.01116.93
7.2.80.0120.00617.01
7.2.70.0030.00516.95
7.2.60.0050.00516.93
7.2.50.0080.00817.00
7.2.40.0080.00416.67
7.2.30.0040.00816.85
7.2.20.0090.00616.59
7.2.10.0120.00016.93
7.2.00.0090.00418.17
7.1.250.0030.00715.59
7.1.240.0000.01415.45
7.1.230.0070.00715.57
7.1.220.0000.00815.55
7.1.210.0030.00515.72
7.1.200.0090.00315.72
7.1.190.0070.00415.80
7.1.180.0070.00715.56
7.1.170.0030.00515.65
7.1.160.0000.01615.95
7.1.150.0080.00815.38
7.1.140.0070.00715.78
7.1.130.0040.00415.56
7.1.120.0000.01015.79
7.1.110.0030.00615.95
7.1.100.0050.00916.88
7.1.90.0000.01115.59
7.1.80.0040.01115.76
7.1.70.0010.00716.42
7.1.60.0070.01017.59
7.1.50.0040.01316.36
7.1.40.0120.00015.56
7.1.30.0040.00815.88
7.1.20.0080.00415.57
7.1.10.0000.01515.54
7.1.00.0110.03518.82
7.0.330.0050.00515.29
7.0.320.0030.00915.35
7.0.310.0040.00815.34
7.0.300.0040.00415.35
7.0.290.0030.01315.28
7.0.280.0030.01315.24
7.0.270.0060.00915.46
7.0.260.0040.00815.29
7.0.250.0040.00815.40
7.0.240.0040.00415.51
7.0.230.0000.01215.34
7.0.220.0060.00315.41
7.0.210.0000.01015.36
7.0.200.0090.00215.97
7.0.190.0000.01315.53
7.0.180.0060.00615.33
7.0.170.0080.00315.54
7.0.160.0080.00315.48
7.0.150.0040.00415.36
7.0.140.0030.04218.72
7.0.130.0000.01415.15
7.0.120.0070.00715.23
7.0.110.0100.00315.31
7.0.100.0000.00915.39
7.0.90.0060.00915.55
7.0.80.0000.01215.43
7.0.70.0040.04218.44
7.0.60.0030.04318.58
7.0.50.0020.04518.56
7.0.40.0030.04216.63
7.0.30.0050.03016.70
7.0.20.0050.04216.76
7.0.10.0070.04216.73
7.0.00.0030.03516.72
5.6.380.0070.00714.63
5.6.370.0070.00314.51
5.6.360.0030.01314.52
5.6.350.0040.00714.18
5.6.340.0110.00414.20
5.6.330.0040.01114.35
5.6.320.0100.00714.61
5.6.310.0070.00714.50
5.6.300.0110.00414.52
5.6.290.0060.00914.31
5.6.280.0060.04117.78
5.6.270.0060.00614.23
5.6.260.0030.00614.26
5.6.250.0100.00014.30
5.6.240.0070.00314.39
5.6.230.0000.01114.25
5.6.220.0070.03917.41
5.6.210.0090.03717.47
5.6.200.0020.04417.63
5.6.190.0030.03617.68
5.6.180.0050.04417.73
5.6.170.0060.04617.46
5.6.160.0050.04517.72
5.6.150.0040.04617.81
5.6.140.0050.02917.67
5.6.130.0010.02617.88
5.6.120.0050.04317.75
5.6.110.0070.02217.67
5.6.100.0030.03317.51
5.6.90.0020.04517.74
5.6.80.0030.04117.27
5.6.70.0020.03317.27
5.6.60.0080.03817.21
5.6.50.0120.03717.44
5.6.40.0130.03017.42
5.6.30.0030.04017.22
5.6.20.0050.03317.20
5.6.10.0020.04617.34
5.6.00.0050.04017.20
5.5.380.0000.00811.18
5.5.370.0030.00611.18
5.5.360.0030.03215.83
5.5.350.0040.03615.74
5.5.340.0080.03916.13
5.5.330.0000.03815.91
5.5.320.0050.03516.05
5.5.310.0020.03516.04
5.5.300.0050.04616.02
5.5.290.0060.02415.98
5.5.280.0030.02516.03
5.5.270.0030.02516.01
5.5.260.0020.03916.03
5.5.250.0060.03815.94
5.5.240.0050.03915.60
5.5.230.0030.04515.71
5.5.220.0030.04115.72
5.5.210.0030.04215.72
5.5.200.0030.04115.73
5.5.190.0070.03815.68
5.5.180.0070.03615.70
5.5.170.0000.01211.18
5.5.160.0020.04315.68
5.5.150.0030.03015.69
5.5.140.0040.04115.65
5.5.130.0020.03915.72
5.5.120.0020.02415.69
5.5.110.0040.02215.62
5.5.100.0020.02315.63
5.5.90.0050.02015.62
5.5.80.0050.01815.56
5.5.70.0020.03315.60
5.5.60.0040.01915.66
5.5.50.0000.02315.66
5.5.40.0030.02315.66
5.5.30.0010.02415.55
5.5.20.0030.01815.64
5.5.10.0030.02215.63
5.5.00.0020.03215.64
5.4.450.0060.03715.36
5.4.440.0020.03115.26
5.4.430.0050.02315.31
5.4.420.0030.03815.33
5.4.410.0010.04215.15
5.4.400.0070.04215.19
5.4.390.0030.04315.19
5.4.380.0050.03615.10
5.4.370.0000.04015.15
5.4.360.0050.03515.10
5.4.350.0040.04215.10
5.4.340.0040.04115.09
5.4.330.0000.01111.18
5.4.320.0080.03715.11
5.4.310.0030.03915.03
5.4.300.0060.03515.10
5.4.290.0070.03815.10
5.4.280.0000.02715.05
5.4.270.0040.02315.10
5.4.260.0030.02115.19
5.4.250.0020.02115.14
5.4.240.0050.01815.16
5.4.230.0030.02015.10
5.4.220.0080.03615.02
5.4.210.0070.01815.12
5.4.200.0030.02015.09
5.4.190.0000.01815.05
5.4.180.0000.02015.12
5.4.170.0030.02715.13
5.4.160.0030.03815.09
5.4.150.0080.03315.01
5.4.140.0030.03913.78
5.4.130.0040.04213.79
5.4.120.0060.02013.76
5.4.110.0020.02713.76
5.4.100.0020.02013.74
5.4.90.0030.02213.81
5.4.80.0030.02113.82
5.4.70.0020.02313.73
5.4.60.0050.02413.82
5.4.50.0040.01513.81
5.4.40.0020.02113.73
5.4.30.0010.01913.81
5.4.20.0020.01813.79
5.4.10.0000.01913.80
5.4.00.0030.01713.53
5.3.290.0060.04012.91
5.3.280.0030.02212.94
5.3.270.0030.01812.85
5.3.260.0040.03812.94
5.3.250.0060.02512.88
5.3.240.0020.02812.85
5.3.230.0050.02212.85
5.3.220.0050.02212.94
5.3.210.0050.02812.84
5.3.200.0000.01912.90
5.3.190.0030.02212.84
5.3.180.0010.02312.90
5.3.170.0050.02112.89
5.3.160.0090.01512.90
5.3.150.0060.01512.85
5.3.140.0020.02012.90
5.3.130.0020.02512.92
5.3.120.0000.02612.92
5.3.110.0020.01812.88
5.3.100.0030.01512.61
5.3.90.0020.01712.62
5.3.80.0000.02012.58
5.3.70.0020.02012.55
5.3.60.0020.01612.62
5.3.50.0050.01512.52
5.3.40.0000.02112.53
5.3.30.0030.01712.49
5.3.20.0070.01312.44
5.3.10.0070.01212.40
5.3.00.0020.01812.48
5.2.170.0050.01211.22
5.2.160.0000.01711.12
5.2.150.0000.01711.21
5.2.140.0030.01211.11
5.2.130.0000.01411.21
5.2.120.0050.01311.20
5.2.110.0020.01311.09
5.2.100.0030.01511.09
5.2.90.0000.01811.09
5.2.80.0050.01211.21
5.2.70.0040.01211.21
5.2.60.0030.01211.18
5.2.50.0020.01511.13
5.2.40.0030.01811.12
5.2.30.0020.02011.13
5.2.20.0000.01711.10
5.2.10.0080.02811.03
5.2.00.0020.03510.91
5.1.60.0020.02910.82
5.1.50.0010.03110.82
5.1.40.0070.02810.82
5.1.30.0030.02610.82
5.1.20.0060.02810.82
5.1.10.0030.02110.82
5.1.00.0020.02510.82
5.0.50.0030.01710.82
5.0.40.0050.02210.82
5.0.30.0050.03010.82
5.0.20.0070.01810.82
5.0.10.0000.02610.82
5.0.00.0000.03510.82
4.4.90.0000.00910.82
4.4.80.0030.00710.82
4.4.70.0020.01310.82
4.4.60.0030.01610.82
4.4.50.0010.01910.82
4.4.40.0000.02810.82
4.4.30.0000.01510.82
4.4.20.0000.01710.82
4.4.10.0050.01610.82
4.4.00.0020.02010.82
4.3.110.0020.01710.82
4.3.100.0010.01910.82
4.3.90.0030.01610.82
4.3.80.0000.02910.82
4.3.70.0020.01910.82
4.3.60.0020.01510.82
4.3.50.0020.01610.82
4.3.40.0000.03110.82
4.3.30.0020.01810.82
4.3.20.0020.01710.82
4.3.10.0000.01910.82
4.3.00.0000.01310.82

preferences:
53.98 ms | 401 KiB | 5 Q