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, 5000000) as $i) { $collection = new Collection([ 'foo', 'bar' ]); foreach ($collection as $item) { echo memory_get_usage() . "\n"; } 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.3.120.0000.01814.79
7.3.110.0080.00814.51
7.3.100.0000.01414.32
7.3.90.0110.00414.62
7.3.80.0000.01714.65
7.3.70.0000.01114.80
7.3.60.0070.00714.44
7.3.50.0100.00014.73
7.3.40.0070.00714.48
7.3.30.0060.01014.65
7.3.20.0070.00716.43
7.3.10.0070.00716.58
7.3.00.0020.01216.30
7.2.240.0030.01314.80
7.2.230.0030.01414.64
7.2.220.0080.00814.96
7.2.210.0040.00914.75
7.2.200.0100.00714.83
7.2.190.0000.01414.72
7.2.180.0000.01114.92
7.2.170.0040.01114.81
7.2.160.0060.00614.89
7.2.150.0000.01216.82
7.2.140.0040.00816.76
7.2.130.0020.01016.48
7.2.120.0050.00816.71
7.2.110.0030.01116.85
7.2.100.0030.00716.74
7.2.90.0040.01416.63
7.2.80.0050.01016.67
7.2.70.0050.00916.36
7.2.60.0070.01016.66
7.2.50.0110.00316.52
7.2.40.0030.01216.64
7.2.30.0050.01116.73
7.2.20.0080.00516.78
7.2.10.0030.01116.59
7.2.00.0100.00716.85
7.1.330.0000.01015.62
7.1.320.0000.01015.41
7.1.310.0060.00615.59
7.1.300.0060.00615.69
7.1.290.0030.01315.80
7.1.280.0000.01415.36
7.1.270.0070.00715.67
7.1.260.0050.00515.41
7.1.250.0070.00515.68
7.1.70.0070.00717.16
7.1.60.0070.01519.46
7.1.50.0060.00616.89
7.1.00.0000.08022.33
7.0.200.0030.00616.49
7.0.140.0030.07321.92
7.0.110.0130.07019.91
7.0.100.0070.09019.96
7.0.90.0070.08019.88
7.0.80.0070.08319.93
7.0.70.0070.08720.02
7.0.60.0130.07320.00
7.0.50.0430.04719.98
7.0.40.0070.06319.69
7.0.30.0030.04319.85
7.0.20.0130.05019.64
7.0.10.0000.05019.71
7.0.00.0170.07319.76
5.6.280.0400.10085.65
5.6.260.0270.10385.29
5.6.250.0130.10785.22
5.6.240.0230.10085.21
5.6.230.0370.13785.28
5.6.220.0230.11785.12
5.6.210.0230.07385.19
5.6.200.0170.11085.28
5.6.190.0300.10785.21
5.6.180.0200.14385.22
5.6.170.0270.07385.26
5.6.160.0330.10785.14
5.6.150.0230.07085.13
5.6.140.0270.13085.33
5.6.130.0270.08085.17
5.6.120.0270.10785.20
5.6.110.0230.11385.21
5.6.100.0330.13785.12
5.6.90.0230.13385.11
5.6.80.0230.06384.51
5.6.70.0370.08784.59
5.6.60.0300.11084.70
5.6.50.0230.07784.38
5.6.40.0230.10384.57
5.6.30.0370.08384.44
5.6.20.0200.08784.49
5.6.10.0330.10784.48
5.6.00.0170.07784.69
5.5.380.0270.07082.21
5.5.370.0300.11382.16
5.5.360.0330.11382.23
5.5.350.0330.06782.25
5.5.340.0300.11082.66
5.5.330.0270.10082.73
5.5.320.0130.14382.65
5.5.310.0270.10082.76
5.5.300.0370.11782.68
5.5.290.0330.12082.55
5.5.280.0130.13082.55
5.5.270.0200.09082.72
5.5.260.0200.07782.71
5.5.250.0300.07382.35
5.5.240.0230.11781.93
5.5.230.0300.12081.83
5.5.220.0330.10382.14
5.5.210.0270.07381.86
5.5.200.0100.08782.08
5.5.190.0230.07381.80
5.5.180.0200.07382.03
5.5.160.0370.11382.10
5.5.150.0270.06081.95
5.5.140.0230.08782.09
5.5.130.0270.09081.90
5.5.120.0300.10381.91
5.5.110.0330.10381.98
5.5.100.0470.09081.77
5.5.90.0300.06781.91
5.5.80.0130.11381.95
5.5.70.0130.08381.68
5.5.60.0230.12081.90
5.5.50.0300.10381.84
5.5.40.0230.07381.99
5.5.30.0400.10081.83
5.5.20.0170.11781.98
5.5.10.0300.10781.83
5.5.00.0400.06081.98
5.4.450.0300.11783.93
5.4.440.0400.10783.84
5.4.430.0230.11383.89
5.4.420.0200.12083.88
5.4.410.0270.11784.04
5.4.400.0230.07783.72
5.4.390.0230.08383.54
5.4.380.0170.11083.59
5.4.370.0170.08083.75
5.4.360.0330.10783.54
5.4.350.0300.09783.60
5.4.340.0300.11783.92
5.4.320.0230.08083.59
5.4.310.0170.08783.92
5.4.300.0230.07783.68
5.4.290.0330.05783.63
5.4.280.0330.10783.54
5.4.270.0270.10783.55
5.4.260.0200.08783.58
5.4.250.0270.09083.58
5.4.240.0200.10783.53
5.4.230.0230.11783.59
5.4.220.0400.08383.56
5.4.210.0370.09083.55
5.4.200.0230.08783.63
5.4.190.0370.08783.62
5.4.180.0330.10383.47
5.4.170.0500.10383.69
5.4.160.0270.10083.68
5.4.150.0170.08083.61
5.4.140.0130.12781.09
5.4.130.0230.09780.97
5.4.120.0200.10781.15
5.4.110.0430.10781.28
5.4.100.0270.11381.01
5.4.90.0130.08081.05
5.4.80.0270.08080.98
5.4.70.0200.06081.12
5.4.60.0200.10381.05
5.4.50.0330.10380.97
5.4.40.0300.11381.14
5.4.30.0230.10380.91
5.4.20.0400.09381.11
5.4.10.0230.12781.10
5.4.00.0370.10380.52
5.3.290.0070.04014.67
5.3.280.0200.04314.60
5.3.270.0100.07014.58
5.3.260.0070.07314.76
5.3.250.0130.06314.84
5.3.240.0070.05714.70
5.3.230.0030.06714.61
5.3.220.0030.03714.57
5.3.210.0170.06314.80
5.3.200.0030.07014.66
5.3.190.0070.08014.53
5.3.180.0070.07314.66
5.3.170.0030.06014.52
5.3.160.0000.03714.60
5.3.150.0100.04714.70
5.3.140.0030.03714.64
5.3.130.0000.08314.70
5.3.120.0070.06014.70
5.3.110.0000.03314.59
5.3.100.0030.04713.91
5.3.90.0070.07714.12
5.3.80.0130.07014.16
5.3.70.0030.07713.98
5.3.60.0030.05014.02
5.3.50.0030.05313.96
5.3.40.0070.08713.96
5.3.30.0070.06713.89
5.3.20.0070.04313.72
5.3.10.0030.04013.67
5.3.00.0030.05313.74

preferences:
43.18 ms | 400 KiB | 5 Q