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; } } gc_enable(); foreach (range(1, 250000) as $i) { $collection = new Collection(array( 'foo', 'bar' )); foreach ($collection as $item) { echo $item; } unset($collection); gc_collect_cycles(); }

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.0371.96522.36
8.3.50.0431.95722.03
8.3.40.0571.84722.38
8.3.30.0531.95022.63
8.3.20.0431.31823.91
8.3.10.0471.12827.61
8.3.00.0201.17324.93
8.2.180.0331.88422.40
8.2.170.0531.85922.96
8.2.160.0431.95924.10
8.2.150.0330.97824.18
8.2.140.0331.23724.66
8.2.130.0371.38426.35
8.2.120.0110.01422.92
8.2.110.0130.01326.30
8.2.100.0160.01623.33
8.2.90.0100.01422.89
8.2.80.0060.01521.50
8.2.70.0030.01721.36
8.2.60.0070.01421.78
8.2.50.0100.01021.25
8.2.40.0030.02023.91
8.2.30.0170.01022.25
8.2.20.0130.01321.64
8.2.10.0070.01421.94
8.2.00.0070.01421.58
8.1.280.0301.97126.02
8.1.270.0431.81029.74
8.1.260.0271.67528.11
8.1.250.0190.00431.85
8.1.240.0260.01326.58
8.1.230.0160.02026.84
8.1.220.0120.00925.14
8.1.210.0070.01524.86
8.1.200.0180.01124.98
8.1.190.0100.01725.00
8.1.180.0110.01124.85
8.1.170.0140.01426.27
8.1.160.0170.01029.65
8.1.150.0060.02226.26
8.1.140.0090.01225.03
8.1.130.0090.01225.51
8.1.120.0070.01725.14
8.1.110.0110.01525.16
8.1.100.0060.01625.17
8.1.90.0100.01325.15
8.1.80.0160.01325.20
8.1.70.0030.01925.10
8.1.60.0160.01025.34
8.1.50.0040.02125.18
8.1.40.0160.01025.22
8.1.30.0140.01025.37
8.1.20.0130.01025.29
8.1.10.0070.01525.21
8.1.00.0070.01725.22
8.0.300.0030.02024.77
8.0.290.0220.00024.68
8.0.280.0160.00625.94
8.0.270.0200.00724.79
8.0.260.0100.01724.75
8.0.250.0100.01324.44
8.0.240.0170.01024.59
8.0.230.0090.01224.57
8.0.220.0160.00924.45
8.0.210.0130.01324.37
8.0.200.0030.02024.53
8.0.190.0100.01424.60
8.0.180.0130.01324.48
8.0.170.0070.01624.53
8.0.160.0100.01424.34
8.0.150.0120.01624.43
8.0.140.0070.02024.44
8.0.130.0160.00621.00
8.0.120.0130.01024.45
8.0.110.0100.01424.39
8.0.100.0040.01924.36
8.0.90.0070.01724.36
8.0.80.0270.03424.44
8.0.70.0090.01624.47
8.0.60.0160.00624.42
8.0.50.0070.01724.49
8.0.30.0630.07324.61
8.0.20.0760.07524.54
8.0.10.0100.01024.40
8.0.00.0650.04224.28
7.4.330.0080.01222.79
7.4.320.0170.00724.15
7.4.300.0140.00724.02
7.4.290.0100.01424.12
7.4.280.0100.01624.10
7.4.270.0120.01224.12
7.4.260.0130.00923.93
7.4.250.0100.01424.00
7.4.240.0070.01524.05
7.4.230.0100.01323.77
7.4.220.0290.04623.93
7.4.210.0220.03824.07
7.4.200.0220.00624.21
7.4.190.0070.01823.94
7.4.160.0900.03424.00
7.4.150.0490.05224.01
7.4.140.0460.03924.02
7.4.130.0500.04324.10
7.4.120.0580.05823.93
7.4.110.0300.05324.12
7.4.100.1030.05224.10
7.4.90.0440.04023.90
7.4.80.0460.06424.20
7.4.70.0210.05324.10
7.4.60.0420.05923.99
7.4.50.0200.01324.07
7.4.40.0390.06524.03
7.4.30.0510.06524.24
7.3.330.0100.01020.81
7.3.320.0060.01320.73
7.3.310.0160.00623.82
7.3.300.0170.00323.76
7.3.290.0400.02823.81
7.3.280.0270.05423.84
7.3.270.0550.06424.24
7.3.260.0770.04623.89
7.3.250.0480.04724.00
7.3.240.0820.03324.00
7.3.230.0480.06123.76
7.3.210.0520.03623.95
7.3.200.0420.05423.93
7.3.190.0590.03624.14
7.3.180.0300.03724.13
7.3.170.0270.05123.94
7.3.160.0270.04723.93
7.2.330.0710.05124.51
7.2.320.0410.06524.42
7.2.310.0450.07224.18
7.2.300.0510.05724.26
7.2.290.0560.07724.18
7.2.100.1080.03822.21
7.2.90.1080.03722.08
7.2.80.4620.02622.22
7.2.70.2770.03222.74
7.2.61.1880.02522.65
7.2.50.3990.02522.63
7.2.40.4750.04222.75
7.2.30.6020.02622.48
7.2.20.3800.03422.72
7.2.10.6720.03822.70
7.2.00.3520.03522.46
7.1.220.1660.02621.46
7.1.210.7760.01621.22
7.1.200.2010.03921.40
7.1.190.9150.02921.46
7.1.180.9350.02521.59
7.1.170.1910.03921.34
7.1.160.5640.03221.25
7.1.150.6870.02021.63
7.1.140.4020.03321.51
7.1.130.2580.03121.32
7.1.120.0950.03721.32
7.1.110.4610.01421.47
7.1.100.2860.02821.29
7.1.90.4380.02321.73
7.1.80.8750.02721.55
7.1.70.5980.03021.36
7.0.310.3530.03621.02
7.0.300.5010.01621.18
7.0.290.5010.03621.12
7.0.280.7350.02621.19
7.0.270.4510.02921.09
7.0.260.3670.03321.39
7.0.250.2950.03021.26
7.0.240.3220.02421.39
7.0.230.2360.02321.23
7.0.220.6120.02321.23
7.0.210.1820.02021.02
5.6.380.0760.06049.14
5.6.370.0480.07549.11
5.6.360.0730.07649.54
5.6.350.0580.04549.38
5.6.340.0850.05949.50
5.6.330.0590.05049.39
5.6.320.0370.08149.63
5.6.310.0740.04849.40

preferences:
48.3 ms | 400 KiB | 5 Q