3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo implements IteratorAggregate { private $data = [ 'foo' => 'bar', 'bar' => 'baz' ]; public function getIterator() { return new ArrayIterator($this->data); } } $Foo = new Foo(); foreach($Foo as $key => $value) { $value = 'in the loop'; } foreach($Foo as $key => &$value) { echo $key, ':', $value, PHP_EOL; }

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.0040.01116.73
8.3.50.0110.00522.10
8.3.40.0140.00418.84
8.3.30.0000.01518.82
8.3.20.0040.00420.16
8.3.10.0000.00823.50
8.3.00.0120.00319.11
8.2.180.0120.00918.41
8.2.170.0120.00322.96
8.2.160.0130.00720.49
8.2.150.0040.00424.18
8.2.140.0140.00424.66
8.2.130.0140.00026.16
8.2.120.0040.00422.16
8.2.110.0040.00419.32
8.2.100.0030.01017.75
8.2.90.0030.00517.97
8.2.80.0040.00417.97
8.2.70.0030.00517.50
8.2.60.0000.01017.93
8.2.50.0000.01018.07
8.2.40.0090.00018.04
8.2.30.0000.00718.07
8.2.20.0040.00417.68
8.2.10.0070.00318.00
8.2.00.0000.01117.66
8.1.280.0100.01025.92
8.1.270.0040.00422.09
8.1.260.0040.00426.35
8.1.250.0000.00828.09
8.1.240.0050.00521.83
8.1.230.0060.00620.89
8.1.220.0000.00817.74
8.1.210.0040.00418.93
8.1.200.0100.00017.35
8.1.190.0060.00317.35
8.1.180.0040.00418.10
8.1.170.0080.00018.61
8.1.160.0070.00021.92
8.1.150.0070.00018.64
8.1.140.0040.00417.37
8.1.130.0000.00717.84
8.1.120.0000.00717.50
8.1.110.0030.00517.48
8.1.100.0040.00417.43
8.1.90.0000.00717.46
8.1.80.0030.00317.50
8.1.70.0070.00017.39
8.1.60.0040.00417.47
8.1.50.0040.00417.51
8.1.40.0060.00317.48
8.1.30.0040.00417.56
8.1.20.0050.00217.55
8.1.10.0050.00317.47
8.1.00.0050.00317.40
8.0.300.0040.00419.96
8.0.290.0070.00316.59
8.0.280.0040.00418.51
8.0.270.0030.00317.37
8.0.260.0070.00016.73
8.0.250.0000.00716.92
8.0.240.0040.00416.86
8.0.230.0030.00316.85
8.0.220.0040.00416.78
8.0.210.0000.00716.96
8.0.200.0000.00616.84
8.0.190.0000.00716.91
8.0.180.0040.00416.82
8.0.170.0070.00016.89
8.0.160.0030.00316.81
8.0.150.0070.00016.83
8.0.140.0040.00416.87
8.0.130.0040.00413.37
8.0.120.0000.00816.81
8.0.110.0040.00416.91
8.0.100.0040.00417.01
8.0.90.0040.00416.87
8.0.80.0090.00716.85
8.0.70.0050.00316.96
8.0.60.0040.00416.86
8.0.50.0000.00816.91
8.0.30.0050.01416.91
8.0.20.0080.01117.40
8.0.10.0000.00716.93
8.0.00.0070.01116.71
7.4.330.0020.00215.09
7.4.320.0000.00616.59
7.4.300.0030.00316.59
7.4.290.0050.00316.36
7.4.280.0040.00416.50
7.4.270.0030.00316.61
7.4.260.0060.00316.50
7.4.250.0040.00416.58
7.4.240.0020.00516.52
7.4.230.0030.00316.26
7.4.220.0150.00616.64
7.4.210.0050.00916.57
7.4.200.0000.00716.49
7.4.190.0000.00816.55
7.4.160.0130.00316.68
7.4.150.0000.01717.40
7.4.140.0110.00617.86
7.4.130.0050.01416.41
7.4.120.0090.00816.64
7.4.110.0120.00616.45
7.4.100.0090.00916.41
7.4.90.0110.01416.48
7.4.80.0090.00919.39
7.4.70.0110.01116.51
7.4.60.0120.00416.41
7.4.50.0000.00416.41
7.4.40.0110.00722.77
7.4.30.0140.00416.46
7.4.00.0100.00314.91
7.3.330.0000.00513.28
7.3.320.0000.00613.24
7.3.310.0040.00416.29
7.3.300.0030.00316.24
7.3.290.0030.01016.33
7.3.280.0120.00416.30
7.3.270.0060.01117.40
7.3.260.0070.01016.36
7.3.250.0150.00716.44
7.3.240.0070.01016.43
7.3.230.0130.00916.61
7.3.210.0120.00816.73
7.3.200.0060.01519.39
7.3.190.0140.00416.37
7.3.180.0110.00716.52
7.3.170.0100.00716.47
7.3.160.0080.00816.21
7.3.120.0030.01314.73
7.2.330.0090.00916.70
7.2.320.0070.01716.61
7.2.310.0040.01416.43
7.2.300.0080.00916.86
7.2.290.0030.01416.78
7.2.60.0450.00316.86
7.2.50.0250.00616.85
7.1.200.0030.01015.73
7.1.100.0030.00618.18
7.1.70.0060.00316.91
7.1.60.0180.00719.33
7.1.50.0110.00416.94
7.1.00.0070.07322.31
7.0.200.0070.00316.46
7.0.140.0000.07022.07
7.0.100.0100.07019.96
7.0.90.0070.08719.88
7.0.80.0100.04319.86
7.0.70.0100.07319.92
7.0.60.0070.06719.93
7.0.50.0100.04320.25
7.0.40.0070.08720.03
7.0.30.0030.06020.08
7.0.20.0000.04719.95
7.0.10.0000.04320.04
7.0.00.0070.08320.13
5.6.280.0070.07020.99
5.6.250.0130.07320.56
5.6.240.0030.08320.63
5.6.230.0000.06020.74
5.6.220.0070.07720.52
5.6.210.0030.09320.67
5.6.200.0100.03721.10
5.6.190.0130.03321.09
5.6.180.0100.07321.06
5.6.170.0100.03321.09
5.6.160.0100.08020.96
5.6.150.0030.04021.07
5.6.140.0030.08721.03
5.6.130.0100.08321.04
5.6.120.0030.08721.10
5.6.110.0070.05720.95
5.6.100.0070.08721.05
5.6.90.0170.07720.98
5.6.80.0030.05020.35
5.6.70.0130.06320.45
5.6.60.0030.08320.39
5.6.50.0030.07020.43
5.6.40.0100.04320.42
5.6.30.0100.04320.30
5.6.20.0070.08020.38
5.6.10.0070.08020.45
5.6.00.0200.05320.38
5.5.380.0230.06720.34
5.5.370.0000.06020.35
5.5.360.0130.09020.35
5.5.350.0070.04720.34
5.5.340.0130.08020.83
5.5.330.0000.08320.80
5.5.320.0130.06020.90
5.5.310.0170.05720.88
5.5.300.0130.07320.77
5.5.290.0170.07320.87
5.5.280.0070.07320.88
5.5.270.0130.07320.80
5.5.260.0100.08320.62
5.5.250.0100.05320.67
5.5.240.0070.07720.28
5.5.230.0030.08320.15
5.5.220.0030.05320.29
5.5.210.0000.08720.29
5.5.200.0130.07020.10
5.5.190.0170.07320.24
5.5.180.0130.06720.18
5.5.160.0070.03720.16
5.5.150.0130.06020.25
5.5.140.0130.07720.23
5.5.130.0070.06720.14
5.5.120.0070.06020.27
5.5.110.0070.08020.25
5.5.100.0070.07720.04
5.5.90.0170.06020.09
5.5.80.0170.07720.12
5.5.70.0070.04020.08
5.5.60.0070.05320.05
5.5.50.0200.06020.05
5.5.40.0100.04020.09
5.5.30.0070.04320.14
5.5.20.0230.06720.02
5.5.10.0070.07720.03
5.5.00.0070.07719.96
5.4.450.0030.05719.50
5.4.440.0270.06019.25
5.4.430.0070.05319.41
5.4.420.0130.05319.48
5.4.410.0100.05019.32
5.4.400.0070.07718.95
5.4.390.0000.06019.16
5.4.380.0100.07319.03
5.4.370.0100.07719.03
5.4.360.0000.04319.12
5.4.350.0130.07319.05
5.4.340.0100.06718.90
5.4.320.0070.08019.18
5.4.310.0230.07719.14
5.4.300.0170.06719.02
5.4.290.0100.07019.19
5.4.280.0170.05319.04
5.4.270.0100.08019.09
5.4.260.0070.07719.04
5.4.250.0070.08019.22
5.4.240.0170.07019.11
5.4.230.0100.07019.15
5.4.220.0070.04719.03
5.4.210.0070.07719.13
5.4.200.0070.06718.89
5.4.190.0100.05019.02
5.4.180.0130.07319.03
5.4.170.0130.06719.04
5.4.160.0030.08319.11
5.4.150.0100.07719.02
5.4.140.0130.07016.41
5.4.130.0030.05716.42
5.4.120.0030.04316.25
5.4.110.0130.06016.34
5.4.100.0070.06316.42
5.4.90.0070.07016.48
5.4.80.0070.07316.47
5.4.70.0070.07316.49
5.4.60.0030.06316.48
5.4.50.0070.05016.45
5.4.40.0000.08316.37
5.4.30.0030.06316.48
5.4.20.0130.05016.40
5.4.10.0000.08316.44
5.4.00.0000.06315.88
5.3.290.0070.04714.77
5.3.280.0030.04314.58
5.3.270.0030.05314.62
5.3.260.0100.06714.61
5.3.250.0100.08314.55
5.3.240.0070.06314.72
5.3.230.0130.06014.64
5.3.220.0030.05314.65
5.3.210.0170.05714.58
5.3.200.0130.07014.57
5.3.190.0070.08014.62
5.3.180.0070.08014.62
5.3.170.0100.07014.49
5.3.160.0070.08014.55
5.3.150.0030.07314.70
5.3.140.0030.08014.57
5.3.130.0130.04014.66
5.3.120.0100.06314.61
5.3.110.0030.04014.53
5.3.100.0070.06014.13
5.3.90.0070.07014.16
5.3.80.0030.07314.04
5.3.70.0000.07014.15
5.3.60.0070.07714.06
5.3.50.0030.03713.87
5.3.40.0030.04013.93
5.3.30.0070.06014.00
5.3.20.0030.04013.61
5.3.10.0030.04013.67
5.3.00.0230.02713.69
5.2.170.0000.03711.88
5.2.160.0070.03011.88
5.2.150.0100.03711.88
5.2.140.0030.03011.88
5.2.130.0030.04311.88
5.2.120.0030.03011.88
5.2.110.0070.02711.88
5.2.100.0100.02311.88
5.2.90.0000.03011.88
5.2.80.0000.03711.88
5.2.70.0030.02711.88
5.2.60.0000.03011.88
5.2.50.0030.02311.88
5.2.40.0000.03011.88
5.2.30.0030.02711.88
5.2.20.0030.02311.88
5.2.10.0070.03311.88
5.2.00.0000.04311.88
5.1.60.0000.02711.88
5.1.50.0000.03011.88
5.1.40.0000.02311.88
5.1.30.0070.02311.88
5.1.20.0030.02311.88
5.1.10.0070.02311.88
5.1.00.0000.03711.88
5.0.50.0030.02011.88
5.0.40.0000.02011.88
5.0.30.0030.03011.88
5.0.20.0000.02311.88
5.0.10.0030.01711.88
5.0.00.0070.02311.88
4.4.90.0070.01011.88
4.4.80.0030.01011.88
4.4.70.0000.01311.88
4.4.60.0000.01711.88
4.4.50.0000.01311.88
4.4.40.0000.02711.88
4.4.30.0000.01711.88
4.4.20.0000.01711.88
4.4.10.0030.01711.88
4.4.00.0030.02311.88
4.3.110.0000.01311.88
4.3.100.0000.01311.88
4.3.90.0030.01311.88
4.3.80.0030.02011.88
4.3.70.0030.01311.88
4.3.60.0070.01011.88
4.3.50.0000.01711.88
4.3.40.0000.02311.88
4.3.30.0000.01311.88
4.3.20.0030.01311.88
4.3.10.0000.01711.88
4.3.00.0000.02011.88

preferences:
35.72 ms | 401 KiB | 5 Q