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([ '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.0401.96320.63
8.3.50.0451.95324.03
8.3.40.0571.89422.61
8.3.30.0531.95122.96
8.3.20.0431.28224.10
8.3.10.0300.94027.60
8.3.00.0470.90524.63
8.2.180.0371.89922.65
8.2.170.0401.87922.96
8.2.160.0371.96724.14
8.2.150.0371.10024.18
8.2.140.0271.23624.66
8.2.130.0271.30026.40
8.2.120.0100.01324.72
8.2.110.0100.01626.41
8.2.100.0130.02021.59
8.2.90.0140.01022.89
8.2.80.0130.01321.38
8.2.70.0100.01321.25
8.2.60.0040.01921.78
8.2.50.0070.01421.25
8.2.40.0170.00724.04
8.2.30.0160.00722.03
8.2.20.0060.01621.45
8.2.10.0070.01321.83
8.2.00.0070.01321.50
8.1.280.0331.97126.14
8.1.270.0371.84431.68
8.1.260.0301.67928.78
8.1.250.0240.00029.57
8.1.240.0100.01631.98
8.1.230.0220.01226.73
8.1.220.0160.01325.43
8.1.210.0040.01824.98
8.1.200.0200.00324.97
8.1.190.0200.00724.75
8.1.180.0090.01824.98
8.1.170.0110.01126.09
8.1.160.0200.00329.72
8.1.150.0100.01626.39
8.1.140.0150.00925.21
8.1.130.0060.01525.53
8.1.120.0100.01025.21
8.1.110.0130.01025.12
8.1.100.0090.01225.00
8.1.90.0070.01425.16
8.1.80.0130.01625.20
8.1.70.0060.01625.07
8.1.60.0030.02325.30
8.1.50.0090.01525.25
8.1.40.0040.01925.20
8.1.30.0140.01425.25
8.1.20.0070.01425.32
8.1.10.0060.01925.21
8.1.00.0100.01325.10
8.0.300.0070.01424.72
8.0.290.0120.00924.66
8.0.280.0170.00325.94
8.0.270.0110.01424.75
8.0.260.0130.01324.88
8.0.250.0070.01424.42
8.0.240.0110.01524.52
8.0.230.0140.00724.48
8.0.220.0140.01024.43
8.0.210.0130.01324.50
8.0.200.0180.00724.54
8.0.190.0030.02024.43
8.0.180.0070.01424.37
8.0.170.0150.01124.49
8.0.160.0150.00624.52
8.0.150.0140.01024.43
8.0.140.0150.00924.41
8.0.130.0100.01320.96
8.0.120.0140.01124.42
8.0.110.0070.01724.43
8.0.100.0070.01824.40
8.0.90.0070.01524.25
8.0.80.0170.04424.43
8.0.70.0150.00624.45
8.0.60.0200.00324.29
8.0.50.0140.00724.31
8.0.30.0850.05424.89
8.0.20.0470.04324.54
8.0.10.0110.01124.36
8.0.00.0580.04224.29
7.4.330.0060.01320.81
7.4.320.0040.01824.05
7.4.300.0100.01423.96
7.4.290.0040.01824.09
7.4.280.0080.01623.91
7.4.270.0080.01524.04
7.4.260.0070.01423.93
7.4.250.0140.00724.06
7.4.240.0100.01524.02
7.4.230.0070.01723.81
7.4.220.0290.04924.14
7.4.210.0160.04124.04
7.4.200.0130.01024.15
7.4.190.0160.01024.18
7.4.160.0330.04323.90
7.4.150.0510.04023.99
7.4.140.0620.05124.26
7.4.130.0470.05324.11
7.4.120.0630.04224.16
7.4.110.0600.05724.11
7.4.100.0830.06024.04
7.4.90.0660.07323.85
7.4.80.0590.04823.95
7.4.70.0390.03624.26
7.4.60.0410.04924.06
7.4.50.0160.01624.16
7.4.40.0380.03823.86
7.4.30.0460.02924.15
7.3.330.0030.02120.96
7.3.320.0060.01320.80
7.3.310.0090.01823.91
7.3.300.0130.00623.82
7.3.290.0360.04623.92
7.3.280.0390.04223.86
7.3.270.0550.03223.96
7.3.260.0570.02524.28
7.3.250.0730.05323.89
7.3.240.0390.04823.88
7.3.230.0580.05823.92
7.3.210.0900.03024.23
7.3.200.0630.04823.75
7.3.190.0500.02523.82
7.3.180.0520.04524.02
7.3.170.0610.06524.18
7.3.160.0610.02923.85
7.2.330.0320.04924.13
7.2.320.0470.05024.36
7.2.310.0530.06624.41
7.2.300.0590.05124.39
7.2.290.0550.03924.36
7.2.100.2480.02222.40
7.2.90.3280.01622.33
7.2.80.1940.02722.46
7.2.70.4990.02422.79
7.2.60.3190.01922.83
7.2.50.4360.01322.63
7.2.40.2770.02322.86
7.2.30.2020.05622.56
7.2.20.4160.03422.77
7.2.10.2410.03822.85
7.2.00.3020.02622.47
7.1.220.2820.01921.56
7.1.210.2550.03621.71
7.1.200.3350.01921.70
7.1.190.5020.02921.38
7.1.180.3430.03221.35
7.1.170.4700.02621.72
7.1.160.3200.02321.48
7.1.150.2230.03121.74
7.1.140.3120.02221.68
7.1.130.3140.02021.55
7.1.120.3530.02721.45
7.1.110.3710.01321.40
7.1.100.2040.03521.72
7.1.90.3180.03921.76
7.1.80.3880.02021.70
7.0.310.3030.02120.99
7.0.300.3260.03321.36
7.0.290.3410.02321.31
7.0.280.3260.01620.93
7.0.270.2200.01621.00
7.0.260.3200.01921.05
7.0.250.3230.02621.02
7.0.240.3060.02621.09
7.0.230.2870.02121.13
7.0.220.2910.02721.31
5.6.380.0640.06149.21
5.6.370.0710.08049.34
5.6.360.0840.07749.50
5.6.350.0550.06349.29
5.6.340.0730.03849.31
5.6.330.0690.03949.23
5.6.320.0650.04249.34

preferences:
39.02 ms | 401 KiB | 5 Q