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.0130.00618.18
8.3.50.0100.01217.68
8.3.40.0070.00718.84
8.3.30.0110.00418.83
8.3.20.0060.00318.72
8.3.10.0050.00320.62
8.3.00.0040.00417.75
8.2.180.0120.00316.75
8.2.170.0040.01122.96
8.2.160.0170.00022.16
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0000.00719.82
8.2.110.0030.00720.54
8.2.100.0080.00317.72
8.2.90.0050.00318.97
8.2.80.0040.00417.97
8.2.70.0050.00317.63
8.2.60.0000.00817.80
8.2.50.0050.00318.07
8.2.40.0040.00419.72
8.2.30.0040.00418.05
8.2.20.0000.00717.54
8.2.10.0000.01017.70
8.2.00.0040.00417.57
8.1.280.0130.00725.92
8.1.270.0040.00424.66
8.1.260.0050.00326.35
8.1.250.0000.00728.09
8.1.240.0000.00922.00
8.1.230.0070.00417.52
8.1.220.0050.00317.74
8.1.210.0000.00918.77
8.1.200.0040.00717.35
8.1.190.0040.00417.51
8.1.180.0050.00318.10
8.1.170.0000.00718.83
8.1.160.0040.00418.83
8.1.150.0000.00818.50
8.1.140.0000.00817.36
8.1.130.0070.00017.44
8.1.120.0070.00017.44
8.1.110.0050.00217.23
8.1.100.0040.00417.41
8.1.90.0000.00717.43
8.1.80.0000.00717.36
8.1.70.0040.00417.31
8.1.60.0060.00317.64
8.1.50.0000.00717.40
8.1.40.0000.00817.42
8.1.30.0040.00417.52
8.1.20.0050.00317.59
8.1.10.0030.00517.46
8.1.00.0030.00517.47
8.0.300.0000.00818.77
8.0.290.0040.00416.63
8.0.280.0030.00318.34
8.0.270.0030.00317.24
8.0.260.0000.00716.83
8.0.250.0040.00416.84
8.0.240.0040.00716.90
8.0.230.0030.00316.88
8.0.220.0030.00316.80
8.0.210.0040.00416.90
8.0.200.0030.00316.99
8.0.190.0070.00016.87
8.0.180.0080.00016.93
8.0.170.0000.00816.95
8.0.160.0030.00516.95
8.0.150.0060.00316.84
8.0.140.0040.00416.93
8.0.130.0050.00013.34
8.0.120.0030.00516.74
8.0.110.0000.00816.72
8.0.100.0070.00016.73
8.0.90.0030.00316.82
8.0.80.0080.01216.82
8.0.70.0030.00516.73
8.0.60.0030.00316.90
8.0.50.0000.00716.71
8.0.30.0110.01017.14
8.0.20.0100.00917.12
8.0.10.0040.00416.90
8.0.00.0070.01016.69
7.4.330.0000.00612.96
7.4.320.0060.00016.67
7.4.300.0000.00616.61
7.4.290.0070.00016.53
7.4.280.0030.00816.61
7.4.270.0000.00616.51
7.4.260.0000.00613.32
7.4.250.0000.00916.45
7.4.240.0030.00316.63
7.4.230.0030.00316.63
7.4.220.0090.00616.56
7.4.210.0080.00616.62
7.4.200.0000.00716.68
7.4.190.0000.00716.66
7.4.160.0060.00916.31
7.4.150.0100.01416.33
7.4.140.0150.00716.59
7.4.130.0080.01116.53
7.4.120.0090.01016.50
7.4.110.0090.00916.37
7.4.100.0150.00416.39
7.4.90.0100.00716.41
7.4.80.0150.00416.63
7.4.70.0030.02016.44
7.4.60.0100.00716.47
7.4.50.0030.00316.65
7.4.40.0060.00616.31
7.4.30.0040.01416.77
7.4.10.0140.00414.92
7.4.00.0080.00614.96
7.3.330.0000.00713.21
7.3.320.0040.00413.29
7.3.310.0000.00716.53
7.3.300.0060.00016.48
7.3.290.0030.01016.44
7.3.280.0080.00716.42
7.3.270.0120.00616.36
7.3.260.0100.00816.49
7.3.250.0150.00516.39
7.3.240.0110.00616.42
7.3.230.0070.01116.34
7.3.210.0100.00716.50
7.3.200.0160.00619.39
7.3.190.0120.00716.51
7.3.180.0090.00916.37
7.3.170.0100.00716.58
7.3.160.0120.00416.50
7.3.130.0060.01014.71
7.3.120.0100.00615.00
7.3.110.0090.00314.88
7.3.100.0000.01214.83
7.3.90.0070.00714.64
7.3.80.0040.00714.71
7.3.70.0070.00714.83
7.3.60.0000.00814.87
7.3.50.0060.01014.90
7.3.40.0030.00614.88
7.3.30.0000.01414.70
7.3.20.0040.01116.72
7.3.10.0050.00816.77
7.3.00.0090.00316.38
7.2.330.0160.00316.63
7.2.320.0090.01316.74
7.2.310.0060.01416.58
7.2.300.0120.00616.52
7.2.290.0070.01016.52
7.2.260.0090.01115.13
7.2.250.0090.00914.94
7.2.240.0030.01314.99
7.2.230.0050.00815.26
7.2.220.0060.00915.12
7.2.210.0070.00715.09
7.2.200.0060.00614.98
7.2.190.0040.01114.89
7.2.180.0070.00714.98
7.2.170.0000.01314.83
7.2.160.0050.00514.78
7.2.150.0110.00416.75
7.2.140.0060.00316.75
7.2.130.0020.01016.93
7.2.120.0050.00916.81
7.2.110.0020.01316.82
7.2.100.0050.01016.80
7.2.90.0080.00816.76
7.2.80.0070.00916.93
7.2.70.0040.00816.79
7.2.60.0100.00716.87
7.2.50.0080.00716.68
7.2.40.0040.01116.85
7.2.30.0070.00616.99
7.2.20.0030.01016.76
7.2.10.0070.00616.70
7.2.00.0040.01117.49
7.1.330.0040.01115.88
7.1.320.0060.01015.70
7.1.310.0030.01115.97
7.1.300.0070.00715.79
7.1.290.0090.00615.52
7.1.280.0150.00015.87
7.1.270.0070.01015.90
7.1.260.0030.00615.98
7.1.250.0030.00715.85
7.1.240.0070.00715.79
7.1.230.0030.01015.75
7.1.220.0040.00915.66
7.1.210.0040.00615.70
7.1.200.0070.00715.83
7.1.190.0050.01015.62
7.1.180.0050.01015.90
7.1.170.0050.00915.62
7.1.160.0090.00615.75
7.1.150.0060.00415.63
7.1.140.0050.00715.76
7.1.130.0060.00815.93
7.1.120.0090.00515.81
7.1.110.0020.01315.90
7.1.100.0050.00816.64
7.1.90.0020.01115.74
7.1.80.0050.00715.76
7.1.70.0030.00816.18
7.1.60.0050.00716.18
7.1.50.0090.00715.95
7.1.40.0020.01215.77
7.1.30.0070.00715.74
7.1.20.0060.00615.79
7.1.10.0050.00815.83
7.1.00.0030.03017.91
7.0.330.0070.00515.46
7.0.320.0090.00615.35
7.0.310.0030.01015.41
7.0.300.0030.00715.17
7.0.290.0050.00815.43
7.0.280.0050.00715.43
7.0.270.0060.00515.31
7.0.260.0020.01015.22
7.0.250.0070.00615.51
7.0.240.0030.00915.55
7.0.230.0000.01215.25
7.0.220.0060.00815.27
7.0.210.0040.00915.24
7.0.200.0050.00915.84
7.0.190.0040.01015.14
7.0.180.0050.00815.29
7.0.170.0050.00615.36
7.0.160.0090.00915.33
7.0.150.0070.00715.26
7.0.140.0050.03017.60
7.0.130.0080.01015.54
7.0.120.0030.03017.61
7.0.110.0060.00515.29
7.0.100.0040.01115.21
7.0.90.0000.01515.37
7.0.80.0080.00315.42
7.0.70.0080.00515.26
7.0.60.0120.03117.02
7.0.50.0070.03016.14
7.0.40.0030.03015.69
7.0.30.0160.02415.59
7.0.20.0230.02115.70
7.0.10.0090.01415.68
7.0.00.0060.03415.65
5.6.400.0070.00314.14
5.6.390.0080.00814.76
5.6.380.0030.00814.16
5.6.370.0030.00714.28
5.6.360.0090.00114.21
5.6.350.0030.01014.34
5.6.340.0040.00914.27
5.6.330.0050.00914.30
5.6.320.0050.00514.48
5.6.310.0070.00514.46
5.6.300.0050.00814.27
5.6.290.0070.00714.44
5.6.280.0050.02916.55
5.6.270.0060.00914.17
5.6.260.0050.00914.54
5.6.250.0050.00814.41
5.6.240.0070.00714.57
5.6.230.0090.00414.52
5.6.220.0030.00814.71
5.6.210.0070.02616.45
5.6.200.0070.03315.61
5.6.190.0060.02716.49
5.6.180.0130.03116.56
5.6.170.0120.03216.50
5.6.160.0080.01716.40
5.6.150.0040.02115.63
5.6.140.0080.01415.74
5.6.130.0070.03315.65
5.6.120.0050.03016.53
5.6.110.0050.01916.76
5.6.100.0080.03116.56
5.6.90.0090.02916.54
5.6.80.0110.03116.31
5.6.70.0080.00614.45
5.6.60.0070.00714.29
5.6.50.0110.00814.46
5.6.40.0080.00514.29
5.6.30.0050.00914.41
5.6.20.0080.00614.35
5.6.10.0050.00714.35
5.6.00.0090.00714.22
5.5.380.0060.00512.78
5.5.370.0040.00912.86
5.5.360.0050.00512.52
5.5.350.0120.01815.08
5.5.340.0060.03214.53
5.5.330.0100.03115.27
5.5.320.0120.02715.19
5.5.310.0140.02315.30
5.5.300.0040.02114.63
5.5.290.0050.01814.49
5.5.280.0060.02215.43
5.5.270.0140.01515.45
5.5.260.0040.02415.52
5.5.250.0070.02715.29
5.5.240.0080.02815.10
5.5.230.0050.01112.63
5.5.220.0050.00812.66
5.5.210.0040.00912.81
5.5.200.0000.00912.49
5.5.190.0040.00712.79
5.5.180.0040.00512.66
5.5.170.0070.00412.54
5.5.160.0070.00712.71
5.5.150.0070.00612.46
5.5.140.0040.00912.78
5.5.130.0020.01012.92
5.5.120.0110.00212.68
5.5.110.0110.00412.53
5.5.100.0060.00812.73
5.5.90.0090.00412.87
5.5.80.0080.00512.57
5.5.70.0030.00612.69
5.5.60.0100.00312.65
5.5.50.0110.00612.75
5.5.40.0140.00612.67
5.5.30.0160.00212.79
5.5.20.0070.00612.79
5.5.10.0090.00912.74
5.5.00.0070.00712.50
5.4.450.0040.02714.43
5.4.440.0100.03014.42
5.4.430.0110.01614.42
5.4.420.0020.02514.39
5.4.410.0060.03214.36
5.4.400.0020.02114.33
5.4.390.0090.02214.35
5.4.380.0080.02714.13
5.4.370.0080.02514.37
5.4.360.0050.01814.36
5.4.350.0070.02514.27
5.4.340.0040.03014.16
5.4.330.0040.00512.00
5.4.320.0080.02114.39
5.4.310.0090.01914.46
5.4.300.0060.02614.31
5.4.290.0120.02714.25
5.4.280.0100.02814.31
5.4.270.0140.02714.33
5.4.260.0070.02814.22
5.4.250.0100.01814.11
5.4.240.0070.02814.18
5.4.230.0100.02714.36
5.4.220.0080.03114.34
5.4.210.0080.02914.33
5.4.200.0070.03014.33
5.4.190.0090.03314.23
5.4.180.0070.01814.23
5.4.170.0080.02814.32
5.4.160.0120.02514.23
5.4.150.0060.02314.28
5.4.140.0050.02913.40
5.4.130.0060.02713.41
5.4.120.0090.02513.45
5.4.110.0080.02713.43
5.4.100.0040.02913.27
5.4.90.0050.03113.41
5.4.80.0060.02513.35
5.4.70.0100.02313.34
5.4.60.0090.02613.38
5.4.50.0060.02713.36
5.4.40.0050.02413.38
5.4.30.0030.02713.57
5.4.20.0030.02813.49
5.4.10.0080.02413.43
5.4.00.0030.02913.18
5.3.290.0070.03112.74
5.3.280.0060.03012.58
5.3.270.0090.02812.73
5.3.260.0090.01912.77
5.3.250.0090.02712.61
5.3.240.0080.02312.67
5.3.230.0030.01912.66
5.3.220.0100.02412.62
5.3.210.0090.02712.58
5.3.200.0050.01712.56
5.3.190.0060.01712.65
5.3.180.0060.03112.69
5.3.170.0050.02712.65
5.3.160.0070.02812.70
5.3.150.0050.02612.69
5.3.140.0050.02412.61
5.3.130.0090.02812.68
5.3.120.0060.01612.65
5.3.110.0070.02312.59
5.3.100.0050.03212.49
5.3.90.0020.03112.41
5.3.80.0060.02812.45
5.3.70.0050.02812.37
5.3.60.0070.03212.50
5.3.50.0060.01612.47
5.3.40.0060.02512.41
5.3.30.0100.01612.43
5.3.20.0030.03012.37
5.3.10.0070.02512.21
5.3.00.0110.02512.31
5.2.170.0090.01310.56
5.2.160.0080.03010.53
5.2.150.0120.03210.50
5.2.140.0030.02410.56
5.2.130.0040.03210.48
5.2.120.0050.02510.45
5.2.110.0060.03610.58
5.2.100.0040.02610.58
5.2.90.0100.03010.52
5.2.80.0110.01510.51
5.2.70.0160.03010.54
5.2.60.0100.01610.42
5.2.50.0100.02110.42
5.2.40.0070.02210.47
5.2.30.0080.03210.44
5.2.20.0040.02410.46
5.2.10.0090.03510.33
5.2.00.0090.01810.25
5.1.60.0080.02710.03
5.1.50.0030.0359.93
5.1.40.0080.03010.02
5.1.30.0080.03210.15
5.1.20.0130.01710.12
5.1.10.0080.02310.01
5.1.00.0070.0239.94
5.0.50.0080.0259.21
5.0.40.0080.0229.18
5.0.30.0070.0249.06
5.0.20.0130.0189.08
5.0.10.0090.0209.04
5.0.00.0030.0279.04
4.4.90.0060.0138.73
4.4.80.0050.0118.73
4.4.70.0070.0108.73
4.4.60.0060.0118.73
4.4.50.0070.0138.73
4.4.40.0040.0188.73
4.4.30.0040.0128.73
4.4.20.0030.0188.73
4.4.10.0050.0178.73
4.4.00.0060.0288.73
4.3.110.0090.0158.73
4.3.100.0040.0208.73
4.3.90.0020.0228.73
4.3.80.0030.0228.73
4.3.70.0060.0208.73
4.3.60.0050.0188.73
4.3.50.0030.0158.73
4.3.40.0030.0278.73
4.3.30.0020.0238.73
4.3.20.0020.0138.73
4.3.10.0030.0118.73
4.3.00.0040.0128.73

preferences:
60.21 ms | 401 KiB | 5 Q