3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Collection extends ArrayObject { protected $iterator; public function getIterator() { $this->iterator = new ArrayIterator($this); return $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.70.0070.00718.30
8.3.60.0170.00316.50
8.3.50.0140.00421.99
8.3.40.0120.00318.79
8.3.30.0070.01019.02
8.3.20.0040.00420.16
8.3.10.0030.00623.50
8.3.00.0000.00820.90
8.2.180.0100.00618.29
8.2.170.0120.00322.96
8.2.160.0140.00020.25
8.2.150.0040.00424.18
8.2.140.0050.00224.66
8.2.130.0070.00026.16
8.2.120.0040.00420.84
8.2.110.0040.00719.26
8.2.100.0090.00317.72
8.2.90.0000.00819.11
8.2.80.0040.00417.97
8.2.70.0030.00617.36
8.2.60.0000.00817.68
8.2.50.0080.00018.07
8.2.40.0030.00619.82
8.2.30.0030.00618.13
8.2.20.0040.00417.48
8.2.10.0070.00017.95
8.2.00.0020.00517.53
8.1.280.0030.01025.92
8.1.270.0030.00623.79
8.1.260.0080.00026.35
8.1.250.0080.00028.09
8.1.240.0030.00620.93
8.1.230.0000.01217.42
8.1.220.0080.00017.74
8.1.210.0040.00418.77
8.1.200.0040.00417.10
8.1.190.0000.00817.00
8.1.180.0060.00318.10
8.1.170.0000.00818.65
8.1.160.0070.00021.96
8.1.150.0000.00718.51
8.1.140.0040.00417.26
8.1.130.0040.00417.73
8.1.120.0020.00517.21
8.1.110.0000.00717.37
8.1.100.0050.00317.41
8.1.90.0070.00017.36
8.1.80.0000.00917.39
8.1.70.0030.00317.32
8.1.60.0000.00917.48
8.1.50.0090.00017.40
8.1.40.0000.00717.41
8.1.30.0080.00017.38
8.1.20.0030.00617.59
8.1.10.0070.00017.39
8.1.00.0090.00017.23
8.0.300.0000.00818.77
8.0.290.0040.00416.63
8.0.280.0000.00718.34
8.0.270.0030.00317.14
8.0.260.0030.00517.16
8.0.250.0000.00716.93
8.0.240.0030.00616.92
8.0.230.0000.00716.79
8.0.220.0000.00716.88
8.0.210.0000.00716.85
8.0.200.0040.00416.87
8.0.190.0000.00716.92
8.0.180.0000.00716.75
8.0.170.0040.00416.78
8.0.160.0000.00716.86
8.0.150.0040.00416.85
8.0.140.0040.00416.68
8.0.130.0050.00013.27
8.0.120.0060.00316.84
8.0.110.0000.00816.83
8.0.100.0080.00016.82
8.0.90.0040.00416.72
8.0.80.0110.01116.80
8.0.70.0040.00416.84
8.0.60.0080.00016.88
8.0.50.0000.00716.82
8.0.30.0150.00316.99
8.0.20.0090.01117.40
8.0.10.0040.00416.91
8.0.00.0100.00716.69
7.4.330.0000.00515.00
7.4.320.0030.00316.52
7.4.300.0000.00616.38
7.4.290.0000.00616.51
7.4.280.0070.00016.48
7.4.270.0040.00416.50
7.4.260.0070.00016.47
7.4.250.0070.00016.35
7.4.240.0040.00316.34
7.4.230.0030.00316.37
7.4.220.0080.01216.40
7.4.210.0070.00816.39
7.4.200.0040.00416.49
7.4.190.0040.00416.36
7.4.160.0070.01016.40
7.4.150.0100.00717.40
7.4.140.0060.01117.86
7.4.130.0060.01116.46
7.4.120.0130.00416.42
7.4.110.0060.01616.34
7.4.100.0120.00916.42
7.4.90.0090.01216.27
7.4.80.0150.00619.39
7.4.70.0120.00316.23
7.4.60.0100.00716.41
7.4.50.0040.00416.45
7.4.40.0160.00016.10
7.4.30.0100.00716.34
7.4.00.0040.01414.80
7.3.330.0030.00313.25
7.3.320.0030.00313.25
7.3.310.0050.00216.27
7.3.300.0030.00316.09
7.3.290.0070.00716.20
7.3.280.0070.01116.21
7.3.270.0100.00817.40
7.3.260.0110.01116.49
7.3.250.0140.00516.32
7.3.240.0120.00816.39
7.3.230.0130.00316.44
7.3.210.0070.01016.25
7.3.200.0090.00919.39
7.3.190.0070.01416.32
7.3.180.0070.00916.32
7.3.170.0040.01516.31
7.3.160.0130.00316.44
7.3.120.0100.00314.70
7.2.330.0080.01316.54
7.2.320.0090.01016.40
7.2.310.0150.00416.21
7.2.300.0100.01316.62
7.2.290.0100.00716.49
7.2.110.0160.00616.57
7.2.60.0070.00716.76
7.2.00.0030.00719.34
7.1.200.0030.01015.61
7.1.100.0220.00417.84
7.1.70.0000.01516.99
7.1.60.0060.01819.46
7.1.50.0060.00916.79
7.1.00.0030.07722.33
7.0.200.0040.00416.61
7.0.140.0070.06722.15
7.0.110.0130.06019.94
7.0.100.0130.08019.98
7.0.90.0100.06719.95
7.0.80.0070.04019.88
7.0.70.0000.08320.04
7.0.60.0230.04019.90
7.0.50.0230.07020.28
7.0.40.0070.08320.29
7.0.30.0130.08020.08
7.0.20.0030.08020.19
7.0.10.0100.06320.17
7.0.00.0100.05720.21
5.6.280.0270.11385.47
5.6.260.0170.10085.34
5.6.250.0430.07385.27
5.6.240.0530.05085.37
5.6.230.0300.12085.21
5.6.220.0270.11385.20
5.6.210.0230.12085.24
5.6.200.0270.11785.64
5.6.190.0330.10785.84
5.6.180.0500.10085.80
5.6.170.0270.12785.80
5.6.160.0370.11085.87
5.6.150.0470.09085.57
5.6.140.0400.10785.84
5.6.130.0400.10385.73
5.6.120.0200.14085.71
5.6.110.0270.11085.93
5.6.100.0270.10785.68
5.6.90.0200.11085.81
5.6.80.0400.11085.30
5.6.70.0100.08385.17
5.6.60.0330.06785.23
5.6.50.0270.11085.30
5.6.40.0470.10085.27
5.6.30.0230.11385.13
5.6.20.0370.11384.94
5.6.10.0230.12085.07
5.6.00.0400.10785.02
5.5.380.0370.10785.01
5.5.370.0270.10085.20
5.5.360.0130.09385.21
5.5.350.0270.06785.11
5.5.340.0330.08785.43
5.5.330.0170.12785.50
5.5.320.0330.08785.55
5.5.310.0430.09785.46
5.5.300.0370.12385.56
5.5.290.0230.08785.58
5.5.280.0200.07385.55
5.5.270.0270.12385.46
5.5.260.0370.10785.53
5.5.250.0330.10385.21
5.5.240.0330.10784.90
5.5.230.0300.06784.99
5.5.220.0330.10385.07
5.5.210.0370.06384.87
5.5.200.0300.11084.90
5.5.190.0300.12384.95
5.5.180.0430.10784.99
5.5.160.0270.08785.04
5.5.150.0330.12784.87
5.5.140.0330.10384.95
5.5.130.0300.11384.91
5.5.120.0270.11084.90
5.5.110.0400.10084.80
5.5.100.0330.11384.91
5.5.90.0330.11384.79
5.5.80.0370.10784.69
5.5.70.0230.12084.82
5.5.60.0470.11084.63
5.5.50.0270.12084.83
5.5.40.0500.10084.80
5.5.30.0330.10384.91
5.5.20.0270.11084.74
5.5.10.0230.11784.70
5.5.00.0330.11084.68
5.4.450.0230.12784.08
5.4.440.0400.09383.92
5.4.430.0200.12083.90
5.4.420.0370.09084.25
5.4.410.0330.10783.89
5.4.400.0230.07083.66
5.4.390.0330.10083.59
5.4.380.0400.10783.94
5.4.370.0200.11783.53
5.4.360.0170.11083.64
5.4.350.0330.12383.59
5.4.340.0400.11083.63
5.4.320.0270.11083.81
5.4.310.0370.08083.69
5.4.300.0300.08783.75
5.4.290.0470.10783.59
5.4.280.0300.07083.55
5.4.270.0330.12083.61
5.4.260.0500.10383.75
5.4.250.0430.10383.84
5.4.240.0430.09083.58
5.4.230.0370.07783.61
5.4.220.0300.12083.89
5.4.210.0330.07783.63
5.4.200.0200.11783.75
5.4.190.0430.10383.83
5.4.180.0370.11383.63
5.4.170.0500.09783.64
5.4.160.0270.12083.91
5.4.150.0570.09383.75
5.4.140.0400.10781.09
5.4.130.0330.12081.06
5.4.120.0300.12380.91
5.4.110.0370.10780.94
5.4.100.0330.12081.28
5.4.90.0430.09381.16
5.4.80.0400.07781.01
5.4.70.0500.09780.96
5.4.60.0300.10380.92
5.4.50.0300.10781.12
5.4.40.0300.08781.13
5.4.30.0200.07081.02
5.4.20.0300.11781.02
5.4.10.0400.10080.96
5.4.00.0300.06380.62
5.3.290.0030.07714.71
5.3.280.0030.07714.64
5.3.270.0100.06714.74
5.3.260.0100.06314.84
5.3.250.0100.07314.70
5.3.240.0100.07314.61
5.3.230.0100.07314.64
5.3.220.0100.07014.58
5.3.210.0070.07014.61
5.3.200.0070.07314.57
5.3.190.0030.08314.57
5.3.180.0100.05714.71
5.3.170.0100.06714.55
5.3.160.0030.06714.64
5.3.150.0070.07714.62
5.3.140.0030.05714.72
5.3.130.0070.07014.58
5.3.120.0000.05314.63
5.3.110.0070.07714.59
5.3.100.0030.04314.04
5.3.90.0030.07014.06
5.3.80.0100.07014.04
5.3.70.0100.07314.11
5.3.60.0070.06714.24
5.3.50.0070.06313.94
5.3.40.0070.03713.96
5.3.30.0070.03313.91
5.3.20.0100.03013.70
5.3.10.0000.05713.66
5.3.00.0070.03313.72

preferences:
40.85 ms | 401 KiB | 5 Q