3v4l.org

run code in 300+ PHP versions simultaneously
<?php class DataContainer implements IteratorAggregate { // create an external Iterator: protected $data; public function __construct(array $data) { $this->data = $data; } public function &getIterator() { foreach ($this->data as &$value) { yield $value; } } } $dataContainer = new DataContainer([77, 78, 79]); foreach ($dataContainer as &$value) { echo $value *= -1,"\n"; } var_dump($dataContainer); foreach($dataContainer as $value); 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.0130.00718.81
8.3.50.0090.00921.33
8.3.40.0040.01118.88
8.3.30.0090.00620.30
8.3.20.0080.00020.48
8.3.10.0040.00421.10
8.3.00.0070.00023.66
8.2.180.0110.00416.48
8.2.170.0090.00622.96
8.2.160.0140.00020.39
8.2.150.0040.00424.18
8.2.140.0000.00824.66
8.2.130.0040.00426.16
8.2.120.0050.00320.54
8.2.110.0060.00319.08
8.2.100.0040.00817.78
8.2.90.0040.00419.26
8.2.80.0050.00219.21
8.2.70.0060.00317.63
8.2.60.0050.00317.93
8.2.50.0000.00818.07
8.2.40.0050.00518.03
8.2.30.0000.00719.42
8.2.20.0030.00517.66
8.2.10.0040.00417.74
8.2.00.0050.00317.75
8.1.280.0120.00925.92
8.1.270.0040.00423.99
8.1.260.0080.00026.35
8.1.250.0080.00028.09
8.1.240.0000.01120.86
8.1.230.0110.00020.84
8.1.220.0050.00518.77
8.1.210.0060.00318.88
8.1.200.0060.00317.47
8.1.190.0050.00217.53
8.1.180.0030.00618.10
8.1.170.0050.00318.49
8.1.160.0040.00418.90
8.1.150.0000.00918.61
8.1.140.0040.00417.39
8.1.130.0000.00717.72
8.1.120.0040.00417.49
8.1.110.0030.00617.34
8.1.100.0000.00717.40
8.1.90.0000.00817.48
8.1.80.0040.00417.41
8.1.70.0040.00417.39
8.1.60.0030.00617.58
8.1.50.0030.00517.39
8.1.40.0050.00317.55
8.1.30.0030.00617.61
8.1.20.0000.00817.56
8.1.10.0000.00917.43
8.1.00.0050.00317.44
8.0.300.0040.00419.85
8.0.290.0000.00717.15
8.0.280.0030.00318.46
8.0.270.0050.00217.25
8.0.260.0000.00616.88
8.0.250.0080.00016.97
8.0.240.0020.00516.97
8.0.230.0070.00016.97
8.0.220.0040.00416.75
8.0.210.0070.00016.77
8.0.200.0030.00317.02
8.0.190.0030.00516.96
8.0.180.0040.00416.80
8.0.170.0040.00416.84
8.0.160.0030.00316.77
8.0.150.0000.00816.82
8.0.140.0000.00716.85
8.0.130.0050.00013.35
8.0.120.0070.00016.89
8.0.110.0040.00416.76
8.0.100.0040.00416.95
8.0.90.0080.00016.79
8.0.80.0140.00316.88
8.0.70.0040.00416.77
8.0.60.0030.00516.69
8.0.50.0040.00416.91
8.0.30.0130.00516.99
8.0.20.0100.01217.40
8.0.10.0000.00817.00
8.0.00.0090.01116.68
7.4.330.0000.00514.99
7.4.320.0000.00616.40
7.4.300.0030.00316.46
7.4.290.0070.00016.51
7.4.280.0070.00016.42
7.4.270.0030.00316.58
7.4.260.0030.00313.32
7.4.250.0050.00316.48
7.4.240.0000.00716.43
7.4.230.0040.00416.26
7.4.220.0070.01016.49
7.4.210.0070.01016.54
7.4.200.0030.00316.32
7.4.190.0000.00716.67
7.4.160.0050.01116.34
7.4.150.0090.00917.40
7.4.140.0100.00717.86
7.4.130.0050.01316.54
7.4.120.0070.01216.54
7.4.110.0040.01516.44
7.4.100.0080.00816.41
7.4.90.0110.01116.57
7.4.80.0120.00519.39
7.4.70.0090.00916.34
7.4.60.0120.00616.59
7.4.50.0040.00416.59
7.4.40.0110.00422.77
7.4.30.0110.00716.39
7.4.00.0070.01114.92
7.3.330.0050.00013.34
7.3.320.0030.00313.36
7.3.310.0000.00716.27
7.3.300.0000.00716.38
7.3.290.0070.01316.33
7.3.280.0120.00516.32
7.3.270.0030.01417.40
7.3.260.0110.00718.24
7.3.250.0110.00716.49
7.3.240.0070.01416.63
7.3.230.0100.01016.39
7.3.210.0180.00316.50
7.3.200.0030.01619.39
7.3.190.0100.00716.36
7.3.180.0060.00916.61
7.3.170.0100.00616.60
7.3.160.0090.01516.47
7.3.120.0090.00615.05
7.2.330.0190.00016.70
7.2.320.0160.00616.41
7.2.310.0150.00616.70
7.2.300.0100.00716.52
7.2.290.0080.00816.84
7.2.00.0030.01019.56
7.1.100.0060.00918.27
7.1.70.0070.00017.29
7.1.60.0110.01519.17
7.1.50.0100.01317.03
7.1.00.0000.03722.30
7.0.200.0050.00216.48
7.0.140.0100.07022.07
7.0.60.0070.08719.92
7.0.50.0030.08317.93
7.0.40.0070.05020.06
7.0.30.0630.05320.13
7.0.20.0300.07020.10
7.0.10.0230.08020.15
7.0.00.0000.04320.07
5.6.280.0000.07721.08
5.6.210.0030.04020.54
5.6.200.0070.08318.16
5.6.190.0070.08320.35
5.6.180.0400.07320.41
5.6.170.0170.05320.48
5.6.160.0030.08720.58
5.6.150.0070.07318.18
5.6.140.0000.04318.14
5.6.130.0130.07318.18
5.6.120.0100.03721.04
5.6.110.0170.05021.03
5.6.100.0070.07721.05
5.6.90.0000.05020.98
5.6.80.0030.07320.54
5.6.70.0400.06020.37
5.5.350.0270.07320.31
5.5.340.0070.08317.96
5.5.330.0070.06320.31
5.5.320.0100.04320.38
5.5.310.0200.05320.50
5.5.300.0030.03717.98
5.5.290.0030.06017.97
5.5.280.0200.07020.87
5.5.270.0170.07320.65
5.5.260.0070.07320.95
5.5.250.0130.07720.71
5.5.240.0070.08020.16
5.4.450.0170.04019.31
5.4.440.0230.05719.54
5.4.430.0200.08019.30
5.4.420.0270.07319.63
5.4.410.0200.08019.16
5.4.400.0270.06019.00
5.4.390.0270.05319.16
5.4.380.0300.05019.16
5.4.370.0200.06018.98
5.4.360.0230.05018.98
5.4.350.0230.07719.22
5.4.340.0230.07019.25
5.4.320.0200.05019.09
5.4.310.0330.06319.20
5.4.300.0270.06018.89
5.4.290.0300.06319.06
5.4.280.0200.04319.16
5.4.270.0300.03319.13
5.4.260.0170.05719.21
5.4.250.0200.04719.30
5.4.240.0370.06018.94
5.4.230.0170.06719.14
5.4.220.0300.05019.14
5.4.210.0270.06718.84
5.4.200.0330.05018.85
5.4.190.0170.03718.98
5.4.180.0170.04719.07
5.4.170.0230.06019.08
5.4.160.0230.06019.11
5.4.150.0430.04719.22
5.4.140.0170.04016.36
5.4.130.0200.04016.56
5.4.120.0170.06316.35
5.4.110.0270.07016.45
5.4.100.0200.06016.55
5.4.90.0230.06016.58
5.4.80.0130.06716.54
5.4.70.0330.05716.25
5.4.60.0200.06716.34
5.4.50.0200.07716.34
5.4.40.0230.06016.43
5.4.30.0170.06716.34
5.4.20.0270.05316.23
5.4.10.0170.07316.51
5.4.00.0270.05316.11
5.3.290.0230.05016.11
5.3.280.0200.04316.11
5.3.270.0200.07016.11
5.3.260.0300.06016.11
5.3.250.0230.03316.11
5.3.240.0300.07716.11
5.3.230.0270.06716.11
5.3.220.0170.03716.11
5.3.210.0200.07716.11
5.3.200.0300.05716.11
5.3.190.0130.08016.11
5.3.180.0130.05016.11
5.3.170.0230.05316.11
5.3.160.0170.04716.11
5.3.150.0270.07016.11
5.3.140.0300.06316.11
5.3.130.0170.06316.11
5.3.120.0230.06316.11
5.3.110.0170.08016.11
5.3.100.0200.06316.11
5.3.90.0200.06716.11
5.3.80.0230.03716.11
5.3.70.0100.04316.11
5.3.60.0270.06716.11
5.3.50.0200.06316.11
5.3.40.0200.07016.11
5.3.30.0170.05716.11
5.3.20.0270.06016.11
5.3.10.0270.05316.11
5.3.00.0200.05016.11
5.2.170.0200.05716.11
5.2.160.0230.05016.11
5.2.150.0200.04716.11
5.2.140.0170.04316.11
5.2.130.0200.06316.11
5.2.120.0230.05316.11
5.2.110.0200.05016.11
5.2.100.0170.06016.11
5.2.90.0230.04716.11
5.2.80.0200.06316.11
5.2.70.0230.05716.11
5.2.60.0170.04316.11
5.2.50.0130.03316.11
5.2.40.0130.03316.11
5.2.30.0170.03316.11
5.2.20.0170.05016.11
5.2.10.0130.04316.11
5.2.00.0130.04316.11
5.1.60.0130.02316.11
5.1.50.0100.02716.11
5.1.40.0070.04316.11
5.1.30.0170.03716.11
5.1.20.0270.04016.11
5.1.10.0130.04716.11
5.1.00.0200.04016.11
5.0.50.0070.02716.11
5.0.40.0170.03716.11
5.0.30.0070.06716.11
5.0.20.0100.03316.11
5.0.10.0130.02016.11
5.0.00.0030.04016.11
4.4.90.0070.02316.11
4.4.80.0130.01716.11
4.4.70.0100.02716.11
4.4.60.0070.02316.11
4.4.50.0070.03716.11
4.4.40.0070.02316.11
4.4.30.0070.03316.11
4.4.20.0130.02316.11
4.4.10.0030.03716.11
4.4.00.0200.04316.11
4.3.110.0070.02716.11
4.3.100.0070.03016.11
4.3.90.0130.01316.11
4.3.80.0100.05316.11
4.3.70.0170.02316.11
4.3.60.0100.02716.11
4.3.50.0070.03716.11
4.3.40.0030.04316.11
4.3.30.0030.02316.11
4.3.20.0030.03016.11
4.3.10.0030.03716.11
4.3.00.0070.03316.11

preferences:
41.99 ms | 401 KiB | 5 Q