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, 50000) as $i) { $collection = new Collection(array( 'foo', 'bar' )); foreach ($collection as $item) { echo memory_get_usage() . "\n"; ob_flush(); } unset($collection); } echo "done\n";

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)
7.4.00.0100.01016.62
7.3.120.0130.01316.58
7.3.110.0090.01316.76
7.3.100.0070.01016.74
7.3.90.0140.00716.60
7.3.80.0110.00716.78
7.3.70.0040.01816.46
7.3.60.0040.02116.48
7.3.50.0130.00916.74
7.3.40.0070.01016.76
7.3.30.0100.01016.23
7.3.20.0110.01118.66
7.3.10.0100.01318.45
7.3.00.0040.00818.82
7.2.250.0130.00717.15
7.2.240.0120.00916.73
7.2.230.0180.00416.68
7.2.220.0090.00916.77
7.2.210.0070.00716.95
7.2.200.0100.01316.90
7.2.190.0060.01616.58
7.2.180.0070.01416.90
7.2.170.0060.00917.03
7.1.330.0120.00617.78
7.1.320.0070.01017.70
7.1.310.0070.01017.54
7.1.300.0000.01517.78
7.1.290.0060.00917.97
7.1.280.0060.01617.76
7.1.270.0070.01017.60
7.1.260.0060.01317.76
7.1.70.0030.00619.04
7.1.60.0160.01019.46
7.1.50.0100.01618.81
7.1.00.0070.08024.24
7.0.200.0040.00818.98
7.0.140.0000.08024.11
7.0.100.0230.08321.96
7.0.90.0100.08721.96
7.0.80.0330.05321.98
7.0.70.0230.07021.87
7.0.60.0370.05721.76
7.0.50.0630.03722.34
7.0.40.0030.09021.64
7.0.30.0200.06721.53
7.0.20.0130.06021.65
7.0.10.0170.07021.67
7.0.00.0130.07721.57
5.6.280.0100.08028.40
5.6.250.0130.05328.26
5.6.240.0070.08328.24
5.6.230.0070.07728.05
5.6.220.0130.04328.36
5.6.210.0100.05728.09
5.6.200.0200.05728.83
5.6.190.0170.06728.67
5.6.180.0100.04328.86
5.6.170.0100.04328.75
5.6.160.0070.07028.50
5.6.150.0200.07028.33
5.6.140.0100.07028.72
5.6.130.0100.04328.76
5.6.120.0170.07328.41
5.6.110.0030.08028.46
5.6.100.0100.07028.64
5.6.90.0070.05328.72
5.6.80.0100.09028.10
5.6.70.0030.06028.07
5.6.60.0030.05028.09
5.6.50.0070.06327.92
5.6.40.0100.06327.99
5.6.30.0030.07727.92
5.6.20.0100.04327.99
5.6.10.0170.07727.96
5.6.00.0070.08728.07
5.5.380.0030.05728.08
5.5.370.0130.09027.88
5.5.360.0170.08328.03
5.5.350.0100.07728.06
5.5.340.0170.07728.41
5.5.330.0100.05028.39
5.5.320.0070.08328.47
5.5.310.0170.06728.32
5.5.300.0030.05028.46
5.5.290.0170.07728.46
5.5.280.0100.04728.53
5.5.270.0030.07728.47
5.5.260.0000.07728.25
5.5.250.0100.09028.29
5.5.240.0100.05027.76
5.5.230.0070.06027.89
5.5.220.0100.08727.94
5.5.210.0070.04727.95
5.5.200.0070.06027.87
5.5.190.0070.05027.74
5.5.180.0100.08327.45
5.5.160.0070.06327.63
5.5.150.0100.08327.64
5.5.140.0070.04327.82
5.5.130.0070.08327.77
5.5.120.0100.06327.82
5.5.110.0070.04327.79
5.5.100.0130.07027.32
5.5.90.0070.08027.53
5.5.80.0070.08027.58
5.5.70.0170.03727.83
5.5.60.0100.07027.80
5.5.50.0100.06727.84
5.5.40.0130.08027.45
5.5.30.0100.04027.64
5.5.20.0000.05027.73
5.5.10.0100.03327.64
5.5.00.0000.05027.56
5.4.450.0130.06326.48
5.4.440.0100.06726.54
5.4.430.0130.06326.72
5.4.420.0200.08726.72
5.4.410.0230.05026.54
5.4.400.0130.05726.56
5.4.390.0100.06026.50
5.4.380.0270.05026.46
5.4.370.0430.05026.40
5.4.360.0200.05726.15
5.4.350.0270.05726.22
5.4.340.0270.08326.33
5.4.320.0200.05726.34
5.4.310.0130.06026.33
5.4.300.0030.06726.45
5.4.290.0200.05326.46
5.4.280.0130.06726.24
5.4.270.0170.05326.32
5.4.260.0300.05026.54
5.4.250.0130.05726.48
5.4.240.0170.05026.36
5.4.230.0200.07026.40
5.4.220.0270.06026.18
5.4.210.0130.06326.35
5.4.200.0070.06726.22
5.4.190.0200.05726.41
5.4.180.0130.05726.20
5.4.170.0170.05326.34
5.4.160.0230.08326.13
5.4.150.0130.06026.43
5.4.140.0170.05323.69
5.4.130.0330.06323.84
5.4.120.0170.05723.53
5.4.110.0130.05723.86
5.4.100.0300.04723.78
5.4.90.0030.03723.94
5.4.80.0070.03724.15
5.4.70.0030.04024.00
5.4.60.0100.03023.92
5.4.50.0070.03323.93
5.4.40.0030.03724.05
5.4.30.0030.03723.65
5.4.20.0030.03323.96
5.4.10.0100.03023.89
5.4.00.0030.04023.52
5.3.290.0200.05321.77
5.3.280.0200.05022.10
5.3.270.0100.08721.74
5.3.260.0070.09721.61
5.3.250.0200.05021.75
5.3.240.0230.06721.73
5.3.230.0100.06721.73
5.3.220.0130.05721.70
5.3.210.0100.06321.71
5.3.200.0270.04721.72
5.3.190.0170.06721.72
5.3.180.0230.04721.71
5.3.170.0170.08321.57
5.3.160.0130.08321.72
5.3.150.0200.08021.63
5.3.140.0100.09021.72
5.3.130.0130.08721.68
5.3.120.0070.06721.63
5.3.110.0130.06021.66
5.3.100.0100.04021.50
5.3.90.0070.03321.73
5.3.80.0230.06721.07
5.3.70.0300.05321.08
5.3.60.0170.05021.27
5.3.50.0130.05720.96
5.3.40.0170.05021.29
5.3.30.0130.05021.04
5.3.20.0230.06721.26
5.3.10.0230.04721.27
5.3.00.0170.05321.24

preferences:
32.03 ms | 401 KiB | 5 Q