3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Collection extends ArrayObject { protected $iterator; public function getIterator() { // Well, this is a heavy object to make, let's memoize it if (!isset($this->iterator)) { $this->iterator = new ArrayIterator($this); } return $this->iterator; } public function __destruct() { unset($this->iterator); } } gc_enable(); foreach (range(1, 5000000) as $i) { $collection = new Collection([ 'foo', 'bar' ]); foreach ($collection as $item) { echo $item; } unset($collection); }

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.0110.00416.36
8.3.50.0120.00521.11
8.3.40.0150.00018.72
8.3.30.0100.00318.94
8.3.20.0040.00420.41
8.3.10.0050.00523.71
8.3.00.0030.00620.95
8.2.180.0040.01118.54
8.2.170.0110.00322.96
8.2.160.0100.00320.43
8.2.150.0050.00324.18
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0040.00419.06
8.2.110.0070.00322.11
8.2.100.0000.01117.57
8.2.90.0040.00419.11
8.2.80.0040.00417.97
8.2.70.0030.00617.35
8.2.60.0050.00617.66
8.2.50.0000.00818.07
8.2.40.0030.00519.70
8.2.30.0030.00718.00
8.2.20.0000.00817.45
8.2.10.0070.00017.87
8.2.00.0000.00817.47
8.1.280.0070.00725.92
8.1.270.0080.00023.84
8.1.260.0070.00026.35
8.1.250.0030.00528.09
8.1.240.0030.00623.82
8.1.230.0080.00319.10
8.1.220.0090.00017.74
8.1.210.0080.00018.77
8.1.200.0000.01117.00
8.1.190.0040.00417.10
8.1.180.0060.00618.10
8.1.170.0000.00818.46
8.1.160.0050.00321.99
8.1.150.0000.00718.43
8.1.140.0040.00417.23
8.1.130.0040.00417.79
8.1.120.0020.00517.37
8.1.110.0040.00417.32
8.1.100.0000.00717.33
8.1.90.0040.00417.35
8.1.80.0030.00517.21
8.1.70.0000.00717.26
8.1.60.0030.00517.47
8.1.50.0030.00617.37
8.1.40.0030.00517.43
8.1.30.0040.00417.55
8.1.20.0080.00017.51
8.1.10.0050.00217.34
8.1.00.0000.00817.31
8.0.300.0070.00018.77
8.0.290.0000.00917.05
8.0.280.0030.00318.28
8.0.270.0070.00017.17
8.0.260.0080.00017.20
8.0.250.0030.00316.91
8.0.240.0060.00416.76
8.0.230.0030.00416.89
8.0.220.0040.00416.88
8.0.210.0030.00316.84
8.0.200.0030.00316.81
8.0.190.0040.00416.87
8.0.180.0050.00316.75
8.0.170.0040.00416.79
8.0.160.0050.00216.84
8.0.150.0050.00316.68
8.0.140.0000.00716.68
8.0.130.0000.00513.20
8.0.120.0040.00416.69
8.0.110.0070.00016.84
8.0.100.0030.00516.94
8.0.90.0000.00716.79
8.0.80.0030.01816.87
8.0.70.0040.00416.89
8.0.60.0030.00316.84
8.0.50.0020.00516.81
8.0.30.0110.01017.04
8.0.20.0070.01217.40
8.0.10.0000.00817.00
8.0.00.0080.01116.66
7.4.330.0060.00015.00
7.4.320.0060.00016.47
7.4.300.0000.00716.50
7.4.290.0000.00716.38
7.4.280.0030.00316.38
7.4.270.0070.00016.32
7.4.260.0040.00416.29
7.4.250.0050.00216.34
7.4.240.0050.00216.41
7.4.230.0000.00716.37
7.4.220.0070.01016.41
7.4.210.0100.00616.45
7.4.200.0000.00716.29
7.4.190.0000.00816.61
7.4.160.0130.00416.45
7.4.150.0050.01417.40
7.4.140.0140.00517.86
7.4.130.0090.00916.46
7.4.120.0110.00816.44
7.4.110.0110.00716.56
7.4.100.0170.00716.45
7.4.90.0070.01016.24
7.4.80.0180.00919.39
7.4.70.0090.00616.33
7.4.60.0130.01016.34
7.4.50.0030.00616.43
7.4.40.0070.01416.44
7.4.30.0060.00916.16
7.4.10.0170.00016.25
7.4.00.0070.00915.74
7.3.330.0000.00713.23
7.3.320.0030.00313.04
7.3.310.0070.00016.05
7.3.300.0000.00816.26
7.3.290.0130.00316.21
7.3.280.0090.00716.22
7.3.270.0100.00717.40
7.3.260.0030.01316.25
7.3.250.0140.00616.30
7.3.240.0070.01116.24
7.3.230.0060.01016.39
7.3.210.0060.00916.33
7.3.200.0040.01519.39
7.3.190.0120.00616.33
7.3.180.0100.01416.40
7.3.170.0160.00616.39
7.3.160.0100.00616.18
7.3.130.0070.01116.17
7.3.120.0050.01315.49
7.3.110.0110.00716.14
7.3.100.0030.01216.26
7.3.90.0150.00016.12
7.3.80.0130.00316.13
7.3.70.0040.01216.11
7.3.60.0070.00416.20
7.3.50.0060.00316.15
7.3.40.0030.01016.27
7.3.30.0070.00716.26
7.3.20.0090.00317.92
7.3.10.0100.00718.14
7.3.00.0040.00818.06
7.2.330.0040.01416.32
7.2.320.0130.00716.62
7.2.310.0100.01316.57
7.2.300.0070.01116.39
7.2.290.0170.00016.31
7.2.260.0070.01116.52
7.2.250.0000.02216.37
7.2.240.0100.00316.36
7.2.230.0030.01416.36
7.2.220.0000.01516.32
7.2.210.0080.00416.26
7.2.200.0000.01116.41
7.2.190.0030.01016.23
7.2.180.0100.00016.29
7.2.170.0000.01316.40
7.2.160.0080.00616.32
7.2.150.0070.01018.01
7.2.140.0090.00618.19
7.2.130.0070.00718.28
7.2.120.0030.01418.00
7.2.110.0040.00718.03
7.2.100.0030.00618.21
7.2.90.0120.00418.44
7.2.80.0080.00518.38
7.2.70.0040.00818.24
7.2.60.0060.00917.30
7.2.50.0060.00618.07
7.2.40.0060.01218.23
7.2.30.0030.00918.32
7.2.20.0090.00618.42
7.2.10.0070.00318.06
7.2.00.0030.01218.73
7.1.330.0040.00717.06
7.1.320.0110.00417.43
7.1.310.0060.00917.18
7.1.300.0000.01617.10
7.1.290.0040.00817.17
7.1.280.0060.00316.99
7.1.270.0110.00417.09
7.1.260.0100.00716.84
7.1.250.0060.00317.16
7.1.240.0000.00917.22
7.1.230.0060.00917.15
7.1.220.0000.01417.27
7.1.210.0040.01117.32
7.1.200.0050.00516.43
7.1.190.0070.00717.21
7.1.180.0030.00717.20
7.1.170.0030.01017.05
7.1.160.0070.01017.34
7.1.150.0030.00917.20
7.1.140.0000.00917.14
7.1.130.0040.00717.02
7.1.120.0120.00317.30
7.1.110.0030.01317.15
7.1.100.0120.00717.51
7.1.90.0040.01217.24
7.1.80.0100.00317.16
7.1.70.0000.00817.18
7.1.60.0050.01218.39
7.1.50.0070.01117.02
7.1.40.0030.00617.01
7.1.30.0090.00617.23
7.1.20.0000.01317.27
7.1.10.0120.00417.21
7.1.00.0050.04119.78
7.0.330.0110.00416.80
7.0.320.0080.00416.77
7.0.310.0070.00716.95
7.0.300.0030.00616.90
7.0.290.0030.01016.99
7.0.280.0060.00616.91
7.0.270.0070.00416.95
7.0.260.0000.01616.76
7.0.250.0110.00416.78
7.0.240.0030.00717.04
7.0.230.0080.00316.96
7.0.220.0070.00317.00
7.0.210.0090.00616.93
7.0.200.0050.00716.73
7.0.190.0070.00716.80
7.0.180.0090.00016.90
7.0.170.0030.01316.80
7.0.160.0000.01616.91
7.0.150.0070.00316.99
7.0.140.0050.03919.46
7.0.130.0100.00717.06
7.0.120.0060.00316.76
7.0.110.0060.00616.80
7.0.100.0060.00616.92
7.0.90.0060.00316.85
7.0.80.0070.00716.69
7.0.70.0030.03019.28
7.0.60.0080.02019.38
7.0.50.0070.04219.41
7.0.40.0050.04217.55
7.0.30.0080.04117.55
7.0.20.0030.02817.38
7.0.10.0040.02717.49
7.0.00.0040.02717.34
5.6.400.0310.05180.23
5.6.390.0320.04280.40
5.6.380.0330.04080.16
5.6.370.0310.04480.50
5.6.360.0320.05280.43
5.6.350.0260.04880.29
5.6.340.0230.05680.21
5.6.330.0370.04780.37
5.6.320.0370.03780.31
5.6.310.0360.04080.47
5.6.300.0330.05080.39
5.6.290.0300.05380.49
5.6.280.0200.09182.88
5.6.270.0300.04480.43
5.6.260.0370.04780.66
5.6.250.0370.04480.17
5.6.240.0360.04280.40
5.6.230.0430.04680.16
5.6.220.0300.07682.88
5.6.210.0290.07682.72
5.6.200.0200.09883.16
5.6.190.0300.09582.97
5.6.180.0320.08782.88
5.6.170.0360.08682.92
5.6.160.0180.09483.09
5.6.150.0280.08783.01
5.6.140.0350.09082.94
5.6.130.0200.09783.06
5.6.120.0280.08083.05
5.6.110.0380.09582.91
5.6.100.0350.08883.00
5.6.90.0300.08282.82
5.6.80.0290.08482.72
5.6.70.0380.05882.67
5.6.60.0400.08782.65
5.6.50.0320.07582.54
5.6.40.0250.08882.60
5.6.30.0410.06682.66
5.6.20.0320.07882.71
5.6.10.0330.07582.66
5.6.00.0300.08282.56
5.5.380.0300.04780.13
5.5.370.0300.04780.29
5.5.360.0320.05682.63
5.5.350.0320.08982.59
5.5.340.0270.07782.88
5.5.330.0350.06782.73
5.5.320.0360.07682.91
5.5.310.0300.06282.98
5.5.300.0180.10382.96
5.5.290.0280.08783.02
5.5.280.0220.10882.77
5.5.270.0270.08982.93
5.5.260.0380.08082.83
5.5.250.0230.09082.82
5.5.240.0280.07182.60
5.5.230.0260.06982.63
5.5.220.0270.08882.46
5.5.210.0320.08582.60
5.5.200.0330.07182.56
5.5.190.0300.08782.52
5.5.180.0310.08182.47
5.5.170.0400.05780.07
5.5.160.0230.06982.59
5.5.150.0250.08582.43
5.5.140.0280.07182.47
5.5.130.0320.08982.61
5.5.120.0280.08382.59
5.5.110.0270.09382.56
5.5.100.0250.07582.50
5.5.90.0230.09882.39
5.5.80.0380.08882.41
5.5.70.0340.08882.34
5.5.60.0350.08782.30
5.5.50.0200.07582.51
5.5.40.0240.08782.54
5.5.30.0400.07582.50
5.5.20.0280.09382.48
5.5.10.0350.08282.33
5.5.00.0210.08882.32
5.4.450.0170.08880.53
5.4.440.0260.08480.38
5.4.430.0370.08080.56
5.4.420.0380.08280.48
5.4.410.0350.08080.41
5.4.400.0270.08780.24
5.4.390.0290.06280.17
5.4.380.0300.07280.16
5.4.370.0270.06580.21
5.4.360.0160.08680.35
5.4.350.0270.09680.28
5.4.340.0330.08180.20
5.4.330.0400.04077.00
5.4.320.0300.07180.37
5.4.310.0290.08480.17
5.4.300.0250.09280.15
5.4.290.0320.09080.28
5.4.280.0340.08280.26
5.4.270.0390.07880.22
5.4.260.0300.07480.24
5.4.250.0350.08080.21
5.4.240.0270.08580.32
5.4.230.0420.06780.29
5.4.220.0210.08180.31
5.4.210.0270.08780.20
5.4.200.0320.07880.37
5.4.190.0360.08680.37
5.4.180.0270.08680.24
5.4.170.0270.06880.44
5.4.160.0250.07880.38
5.4.150.0150.06980.37
5.4.140.0300.08079.13
5.4.130.0320.07878.99
5.4.120.0250.06778.87
5.4.110.0330.08178.90
5.4.100.0350.08779.02
5.4.90.0360.08178.99
5.4.80.0260.08379.02
5.4.70.0320.07778.98
5.4.60.0180.08978.95
5.4.50.0270.07778.98
5.4.40.0270.06579.05
5.4.30.0370.08079.01
5.4.20.0270.08078.94
5.4.10.0280.07678.92
5.4.00.0280.08678.66
5.3.290.0030.03314.69
5.3.280.0030.02514.66
5.3.270.0040.02514.59
5.3.260.0050.02814.64
5.3.250.0010.04114.77
5.3.240.0020.04314.71
5.3.230.0020.04714.70
5.3.220.0040.02714.64
5.3.210.0070.02214.62
5.3.200.0030.04214.68
5.3.190.0020.03914.70
5.3.180.0020.04314.71
5.3.170.0030.04014.66
5.3.160.0020.03014.80
5.3.150.0030.04214.66
5.3.140.0060.02514.74
5.3.130.0020.04714.67
5.3.120.0020.04214.67
5.3.110.0050.03714.67
5.3.100.0020.04214.77
5.3.90.0030.04014.71
5.3.80.0020.04214.79
5.3.70.0040.03914.67
5.3.60.0020.03714.67
5.3.50.0000.04414.64
5.3.40.0030.02814.65
5.3.30.0000.04414.64
5.3.20.0000.04214.63
5.3.10.0000.04114.53
5.3.00.0000.04214.54

preferences:
38.48 ms | 401 KiB | 5 Q