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, 15000) 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.0300.22116.88
8.3.50.0360.26721.96
8.3.40.0630.14018.97
8.3.30.0430.15319.39
8.3.20.0070.10620.29
8.3.10.0240.05223.53
8.3.00.0100.06619.14
8.2.180.0400.11618.16
8.2.170.0390.11222.96
8.2.160.0370.21120.77
8.2.150.0360.08224.18
8.2.140.0170.07924.66
8.2.130.0160.12826.16
8.2.120.0160.01018.00
8.2.110.0030.02322.11
8.2.100.0160.01319.51
8.2.90.0060.01317.88
8.2.80.0030.01519.01
8.2.70.0070.01318.17
8.2.60.0100.01317.75
8.2.50.0070.01317.88
8.2.40.0100.01020.07
8.2.30.0000.02318.54
8.2.20.0070.01517.91
8.2.10.0070.01318.38
8.2.00.0110.01117.89
8.1.280.0300.24225.92
8.1.270.0260.15223.96
8.1.260.0230.16926.35
8.1.250.0150.00928.09
8.1.240.0130.01023.72
8.1.230.0210.01019.47
8.1.220.0100.01018.29
8.1.210.0100.01018.77
8.1.200.0170.01017.75
8.1.190.0080.01117.85
8.1.180.0100.01018.10
8.1.170.0100.01017.85
8.1.160.0040.01522.60
8.1.150.0030.01719.12
8.1.140.0070.01717.98
8.1.130.0070.01518.36
8.1.120.0060.01318.00
8.1.110.0070.01318.02
8.1.100.0120.00617.89
8.1.90.0030.01717.89
8.1.80.0140.01017.99
8.1.70.0110.01117.88
8.1.60.0130.01018.13
8.1.50.0070.01318.04
8.1.40.0030.01718.03
8.1.30.0100.01318.09
8.1.20.0120.00918.07
8.1.10.0100.01017.97
8.1.00.0140.00718.00
8.0.300.0000.02018.77
8.0.290.0120.00816.87
8.0.280.0070.01118.91
8.0.270.0130.00617.67
8.0.260.0100.01317.72
8.0.250.0130.01017.30
8.0.240.0100.01317.26
8.0.230.0000.02117.25
8.0.220.0030.01517.20
8.0.210.0130.00717.15
8.0.200.0030.01617.38
8.0.190.0070.01617.27
8.0.180.0060.01217.36
8.0.170.0110.01117.25
8.0.160.0070.01317.26
8.0.150.0070.01817.29
8.0.140.0120.00917.20
8.0.130.0030.01313.78
8.0.120.0070.01417.32
8.0.110.0030.01717.35
8.0.100.0080.01217.22
8.0.90.0150.00717.26
8.0.80.0240.03417.29
8.0.70.0030.01617.11
8.0.60.0120.00617.07
8.0.50.0040.01417.10
8.0.30.0500.04417.29
8.0.20.0630.04817.58
8.0.10.0070.01117.37
8.0.00.0620.03317.15
7.4.330.0130.00715.00
7.4.320.0030.01516.86
7.4.300.0110.00716.84
7.4.290.0100.01016.76
7.4.280.0030.01616.93
7.4.270.0090.00916.94
7.4.260.0100.01316.83
7.4.250.0000.02016.91
7.4.240.0090.01216.96
7.4.230.0000.01716.95
7.4.220.0200.05116.90
7.4.210.0240.03716.96
7.4.200.0080.01217.05
7.4.190.0070.01417.10
7.4.160.0560.04316.87
7.4.150.0390.03917.40
7.4.140.0430.05517.86
7.4.130.0520.04716.91
7.4.120.0260.06316.97
7.4.110.0420.03816.72
7.4.100.0560.04116.85
7.4.90.0540.04416.88
7.4.80.0540.06619.39
7.4.70.0530.03616.75
7.4.60.0500.04716.84
7.4.50.0170.01416.96
7.4.40.0200.04717.02
7.4.30.0380.03616.78
7.3.330.0060.01613.77
7.3.320.0090.01213.58
7.3.310.0030.01616.75
7.3.300.0110.00716.53
7.3.290.0290.04316.63
7.3.280.0200.04316.69
7.3.270.0450.03017.40
7.3.260.0640.05816.60
7.3.250.0460.05116.66
7.3.240.0540.06216.81
7.3.230.0440.05416.75
7.3.210.0340.04916.61
7.3.200.0200.06619.39
7.3.190.0290.04617.01
7.3.180.0430.02816.89
7.3.170.0190.04516.74
7.3.160.0360.04316.85
7.2.330.0370.06517.16
7.2.320.0480.04717.17
7.2.310.0460.05516.87
7.2.300.0400.05717.29
7.2.290.0260.05216.98
7.2.100.0420.01715.27
7.2.90.0360.01614.80
7.2.80.0240.03414.79
7.2.70.2600.02515.06
7.2.60.0370.01715.43
7.2.50.0390.03115.49
7.2.40.0370.02515.30
7.2.30.0970.01915.27
7.2.20.0380.02015.43
7.2.10.1980.02815.41
7.2.00.2050.03815.29
7.1.220.2250.03414.21
7.1.210.0430.04014.11
7.1.200.0270.03914.36
7.1.190.2290.03514.21
7.1.180.1090.02814.25
7.1.170.0430.02314.29
7.1.160.2880.03914.10
7.1.150.1300.01914.01
7.1.140.1690.02014.20
7.1.130.1030.02114.32
7.1.120.2020.03114.46
7.1.110.2510.03314.41
7.1.100.0400.02114.27
7.1.90.0480.03314.26
7.1.80.1220.02614.24
7.1.70.1190.03014.21
7.1.60.0260.05332.37
7.1.50.0560.04732.03
7.1.40.1360.02632.52
7.1.30.1560.02432.32
7.1.20.2310.04632.11
7.0.310.0590.02813.85
7.0.300.2450.04413.95
7.0.290.2340.01013.82
7.0.280.2220.02713.88
7.0.270.0310.04613.70
7.0.260.0480.03313.96
7.0.250.1710.02514.22
7.0.240.0510.02513.88
7.0.230.2640.02513.67
7.0.220.2340.03213.77
7.0.210.0660.02613.97
7.0.200.1260.02714.10
7.0.190.2680.01914.00
7.0.180.0350.03713.94
7.0.170.0310.02114.14
5.6.380.0330.03716.36
5.6.370.0520.00816.54
5.6.360.0240.04016.30
5.6.350.0390.03616.53
5.6.340.0330.03016.20
5.6.330.0260.03616.54
5.6.320.0100.05416.66
5.6.310.0300.02716.43

preferences:
50.59 ms | 401 KiB | 5 Q