3v4l.org

run code in 300+ PHP versions simultaneously
<?php class DataContainer implements IteratorAggregate { protected $data; public function __construct(array $data) { $this->data = $data; } public function &getIterator() { foreach ($this->data as $key => &$value) { yield $key => $value; } } } $dataContainer = new DataContainer([1, 2, 3]); foreach (array_keys($dataContainer) as $key) { $dataContainer[$key] *= -1; } var_dump($dataContainer);

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.0120.00316.88
8.3.50.0100.00917.42
8.3.40.0140.00718.79
8.3.30.0110.00718.83
8.3.20.0090.00018.94
8.3.10.0080.00020.34
8.3.00.0050.00317.75
8.2.180.0070.01116.88
8.2.170.0090.00622.96
8.2.160.0030.01020.38
8.2.150.0070.00024.18
8.2.140.0000.00724.66
8.2.130.0040.00426.16
8.2.120.0080.00019.89
8.2.110.0070.00321.04
8.2.100.0110.00017.97
8.2.90.0040.00419.23
8.2.80.0050.00317.93
8.2.70.0030.00717.62
8.2.60.0050.00318.04
8.2.50.0090.00018.07
8.2.40.0080.00018.34
8.2.30.0040.00418.08
8.2.20.0000.00817.79
8.2.10.0040.00417.73
8.2.00.0080.00017.81
8.1.280.0100.00725.92
8.1.270.0040.00424.66
8.1.260.0030.00626.35
8.1.250.0050.00328.09
8.1.240.0030.00622.41
8.1.230.0040.00820.89
8.1.220.0000.00817.74
8.1.210.0000.00818.85
8.1.200.0060.00317.48
8.1.190.0000.00917.40
8.1.180.0000.00818.10
8.1.170.0030.00618.84
8.1.160.0050.00318.94
8.1.150.0040.00418.51
8.1.140.0030.00617.47
8.1.130.0000.00717.87
8.1.120.0050.00317.50
8.1.110.0030.00517.50
8.1.100.0000.00717.37
8.1.90.0030.00517.38
8.1.80.0000.00717.37
8.1.70.0000.00717.48
8.1.60.0020.00517.54
8.1.50.0000.00817.41
8.1.40.0040.00417.59
8.1.30.0040.00417.60
8.1.20.0040.00417.63
8.1.10.0030.00517.58
8.1.00.0000.00717.49
8.0.300.0040.00419.85
8.0.290.0000.00716.88
8.0.280.0040.00418.36
8.0.270.0050.00217.20
8.0.260.0000.00716.89
8.0.250.0040.00417.05
8.0.240.0040.00417.00
8.0.230.0000.00717.02
8.0.220.0030.00316.79
8.0.210.0030.00316.95
8.0.200.0060.00016.87
8.0.190.0060.00316.99
8.0.180.0030.00516.90
8.0.170.0060.00317.00
8.0.160.0000.00817.05
8.0.150.0040.00416.80
8.0.140.0070.00416.84
8.0.130.0000.00513.41
8.0.120.0000.00717.00
8.0.110.0000.00716.75
8.0.100.0050.00317.00
8.0.90.0000.00716.86
8.0.80.0090.00917.02
8.0.70.0050.00216.86
8.0.60.0000.00716.94
8.0.50.0000.00716.94
8.0.30.0110.00817.11
8.0.20.0110.00817.01
8.0.10.0040.00416.99
8.0.00.0140.00316.74
7.4.330.0050.00013.11
7.4.320.0060.00016.62
7.4.300.0000.00716.63
7.4.290.0000.00716.61
7.4.280.0040.00416.54
7.4.270.0070.00016.53
7.4.260.0000.00513.22
7.4.250.0060.00316.49
7.4.240.0000.00716.65
7.4.230.0080.00016.68
7.4.220.0150.00316.55
7.4.210.0080.00816.60
7.4.200.0040.00416.30
7.4.190.0000.00716.42
7.4.160.0060.01016.54
7.4.150.0180.00316.57
7.4.140.0060.01116.55
7.4.130.0110.00616.63
7.4.120.0090.00816.54
7.4.110.0160.00616.70
7.4.100.0110.00516.46
7.4.90.0090.00916.41
7.4.80.0120.00616.66
7.4.70.0060.01416.59
7.4.60.0090.00616.62
7.4.50.0030.00616.53
7.4.40.0040.00716.43
7.4.30.0120.00416.51
7.4.00.0040.01215.02
7.3.330.0000.00713.24
7.3.320.0050.00013.14
7.3.310.0000.00716.41
7.3.300.0030.00316.16
7.3.290.0040.01116.31
7.3.280.0100.00816.29
7.3.270.0150.00316.51
7.3.260.0120.00716.38
7.3.250.0130.00916.36
7.3.240.0130.00916.47
7.3.230.0100.01016.47
7.3.210.0060.01216.35
7.3.200.0090.01219.39
7.3.190.0210.00016.58
7.3.180.0070.01016.43
7.3.170.0080.00816.45
7.3.160.0110.00716.43
7.3.120.0030.00914.70
7.2.330.0120.00616.44
7.2.320.0150.00316.80
7.2.310.0110.00816.68
7.2.300.0030.01316.72
7.2.290.0090.00616.45
7.2.00.0100.00019.43
7.1.100.0040.01117.96
7.1.70.0040.00417.05
7.1.60.0060.01819.40
7.1.50.0000.02116.74
7.1.00.0070.07722.33
7.0.200.0150.00414.44
7.0.140.0000.07721.90
7.0.120.0000.07722.08
7.0.60.0030.04319.92
7.0.50.0070.03717.86
7.0.40.0130.08020.11
7.0.30.0270.07320.21
7.0.20.0400.04720.06
7.0.10.0100.04720.23
7.0.00.0000.07020.23
5.6.280.0000.07721.00
5.6.210.0070.08320.65
5.6.200.0100.04718.20
5.6.190.0130.04720.41
5.6.180.0330.05320.41
5.6.170.0170.04020.57
5.6.160.0130.06720.55
5.6.150.0000.05018.29
5.6.140.0070.04718.19
5.6.130.0070.06318.19
5.6.120.0130.03721.01
5.6.110.0130.07320.96
5.6.100.0000.05021.03
5.6.90.0130.07020.91
5.6.80.0100.08020.38
5.6.70.4370.04020.50
5.5.350.0270.07320.40
5.5.340.0070.06318.08
5.5.330.0070.06720.13
5.5.320.0200.03720.41
5.5.310.0230.08720.27
5.5.300.0030.08317.95
5.5.290.0070.03717.99
5.5.280.0070.04020.66
5.5.270.0100.06720.97
5.5.260.0100.08720.79
5.5.250.0070.03720.62
5.5.240.0100.07720.27
5.4.450.0130.05319.18
5.4.440.0100.07719.48
5.4.430.0030.07319.20
5.4.420.0000.04719.17
5.4.410.0100.03019.32
5.4.400.0030.04718.88
5.4.390.0030.03718.85
5.4.380.0070.04019.12
5.4.370.0030.03719.14
5.4.360.0030.04719.24
5.4.350.0100.04318.87
5.4.340.0030.03719.24
5.4.320.0100.04019.20
5.4.310.0030.04018.92
5.4.300.0030.08019.07
5.4.290.0000.06719.14
5.4.280.0070.05319.14
5.4.270.0000.04719.14
5.4.260.0170.04319.20
5.4.250.0100.03319.14
5.4.240.0100.06718.97
5.4.230.0070.07019.25
5.4.220.0030.04019.23
5.4.210.0070.05018.96
5.4.200.0030.04019.23
5.4.190.0070.05019.13
5.4.180.0100.07719.19
5.4.170.0100.04319.14
5.4.160.0070.04719.24
5.4.150.0100.07319.13
5.4.140.0030.04716.51
5.4.130.0170.04716.46
5.4.120.0200.06316.46
5.4.110.0100.07316.38
5.4.100.0070.07316.43
5.4.90.0100.07716.38
5.4.80.0070.03716.37
5.4.70.0100.03016.27
5.4.60.0100.06316.40
5.4.50.0000.03716.66
5.4.40.0070.05316.39
5.4.30.0070.04316.27
5.4.20.0030.04716.49
5.4.10.0070.07316.26
5.4.00.0070.06315.69
5.3.290.0030.06314.72
5.3.280.0070.03314.66
5.3.270.0070.07014.63
5.3.260.0130.07314.64
5.3.250.0030.03714.66
5.3.240.0070.07014.64
5.3.230.0030.05714.61
5.3.220.0070.05014.60
5.3.210.0100.06714.59
5.3.200.0000.06014.71
5.3.190.0030.06314.75
5.3.180.0100.06314.60
5.3.170.0000.04714.61
5.3.160.0030.03714.45
5.3.150.0130.02714.58
5.3.140.0100.04314.61
5.3.130.0070.07014.58
5.3.120.0030.07314.55
5.3.110.0030.04714.72
5.3.100.0100.03714.07
5.3.90.0170.06314.02
5.3.80.0030.06314.04
5.3.70.0030.08014.09
5.3.60.0030.06014.07
5.3.50.0070.05013.87
5.3.40.0070.07313.91
5.3.30.0130.03013.83
5.3.20.0030.03713.77
5.3.10.0100.06713.81
5.3.00.0030.04313.68
5.2.170.0030.03711.20
5.2.160.0000.03311.21
5.2.150.0030.04311.14
5.2.140.0000.03711.11
5.2.130.0030.04011.11
5.2.120.0030.06011.03
5.2.110.0100.05711.07
5.2.100.0070.05711.07
5.2.90.0030.06711.07
5.2.80.0070.04711.16
5.2.70.0000.04011.19
5.2.60.0070.04711.09
5.2.50.0030.05011.03
5.2.40.0030.03711.05
5.2.30.0170.01710.98
5.2.20.0070.05311.01
5.2.10.0100.05710.95
5.2.00.0000.06010.88
5.1.60.0030.05310.88
5.1.50.0000.04310.88
5.1.40.0000.02710.88
5.1.30.0030.03310.88
5.1.20.0000.03010.88
5.1.10.0030.04710.88
5.1.00.0030.04010.88
5.0.50.0000.04710.88
5.0.40.0000.02310.88
5.0.30.0030.06310.88
5.0.20.0000.04010.88
5.0.10.0070.01310.88
5.0.00.0000.03710.88
4.4.90.0070.03310.88
4.4.80.0030.03310.88
4.4.70.0000.02710.88
4.4.60.0000.02310.88
4.4.50.0000.01710.88
4.4.40.0030.05010.88
4.4.30.0070.02010.88
4.4.20.0000.01710.88
4.4.10.0000.02310.88
4.4.00.0030.05710.88
4.3.110.0030.03310.88
4.3.100.0000.01710.88
4.3.90.0000.01710.88
4.3.80.0000.05310.88
4.3.70.0070.02710.88
4.3.60.0070.03310.88
4.3.50.0070.03010.88
4.3.40.0030.05010.88
4.3.30.0000.03710.88
4.3.20.0000.02010.88
4.3.10.0030.02010.88
4.3.00.0030.02310.88

preferences:
42.9 ms | 401 KiB | 5 Q