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"; } // Weird result from neglecting to unset $value ... 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.0100.01018.55
8.3.50.0070.01021.14
8.3.40.0150.00618.91
8.3.30.0070.00719.99
8.3.20.0030.00620.48
8.3.10.0080.00020.96
8.3.00.0070.00023.61
8.2.180.0150.00616.63
8.2.170.0040.01122.96
8.2.160.0030.01020.35
8.2.150.0040.00424.18
8.2.140.0070.00024.66
8.2.130.0040.00426.16
8.2.120.0030.00521.13
8.2.110.0100.00019.21
8.2.100.0060.00617.72
8.2.90.0080.00019.20
8.2.80.0060.00318.03
8.2.70.0000.00817.50
8.2.60.0040.00417.93
8.2.50.0000.00818.07
8.2.40.0000.00918.22
8.2.30.0050.00219.43
8.2.20.0080.00017.60
8.2.10.0000.00717.62
8.2.00.0050.00317.80
8.1.280.0070.01125.92
8.1.270.0040.00423.99
8.1.260.0050.00226.35
8.1.250.0030.00628.09
8.1.240.0000.01023.96
8.1.230.0110.00020.91
8.1.220.0050.00318.77
8.1.210.0000.00919.11
8.1.200.0000.00917.25
8.1.190.0060.00317.53
8.1.180.0050.00318.10
8.1.170.0090.00018.61
8.1.160.0070.00018.78
8.1.150.0040.00418.60
8.1.140.0040.00417.44
8.1.130.0000.00717.82
8.1.120.0000.00817.55
8.1.110.0000.00717.34
8.1.100.0070.00017.50
8.1.90.0050.00317.39
8.1.80.0070.00017.50
8.1.70.0000.00717.39
8.1.60.0070.00417.60
8.1.50.0040.00417.48
8.1.40.0040.00417.51
8.1.30.0040.00417.47
8.1.20.0000.00917.70
8.1.10.0070.00017.48
8.1.00.0000.00717.51
8.0.300.0000.00819.89
8.0.290.0000.00717.18
8.0.280.0070.00018.44
8.0.270.0040.00417.20
8.0.260.0000.00816.68
8.0.250.0040.00416.93
8.0.240.0080.00016.82
8.0.230.0000.00716.86
8.0.220.0030.00516.87
8.0.210.0000.00716.88
8.0.200.0030.00316.89
8.0.190.0030.00316.86
8.0.180.0040.00416.88
8.0.170.0040.00416.82
8.0.160.0040.00416.88
8.0.150.0030.00516.75
8.0.140.0000.00716.77
8.0.130.0030.00313.31
8.0.120.0000.00716.74
8.0.110.0040.00416.91
8.0.100.0000.00716.85
8.0.90.0000.00716.76
8.0.80.0090.00616.77
8.0.70.0000.00716.95
8.0.60.0050.00316.91
8.0.50.0040.00416.76
8.0.30.0110.00717.07
8.0.20.0100.00917.40
8.0.10.0040.00417.13
8.0.00.0090.01116.78
7.4.330.0000.00515.05
7.4.320.0030.00616.51
7.4.300.0040.00416.61
7.4.290.0000.00716.51
7.4.280.0030.00516.51
7.4.270.0030.00316.61
7.4.260.0050.00013.27
7.4.250.0000.00716.46
7.4.240.0000.00716.56
7.4.230.0040.00416.67
7.4.220.0060.01216.54
7.4.210.0060.01016.64
7.4.200.0030.00316.36
7.4.190.0030.00616.49
7.4.160.0130.00316.55
7.4.150.0000.01817.40
7.4.140.0080.01017.86
7.4.130.0050.01216.60
7.4.120.0110.00716.63
7.4.110.0140.00516.65
7.4.100.0130.00616.68
7.4.90.0140.01016.58
7.4.80.0090.01119.39
7.4.70.0090.01216.52
7.4.60.0090.01216.56
7.4.50.0000.00816.37
7.4.40.0100.00322.77
7.4.30.0080.00916.35
7.4.00.0100.00714.87
7.3.330.0000.00513.23
7.3.320.0000.00513.36
7.3.310.0040.00416.37
7.3.300.0000.00816.23
7.3.290.0050.01516.38
7.3.280.0090.01116.35
7.3.270.0080.00817.40
7.3.260.0140.00818.24
7.3.250.0070.01316.53
7.3.240.0070.01116.58
7.3.230.0100.01216.39
7.3.210.0110.00616.58
7.3.200.0030.01619.39
7.3.190.0130.01016.32
7.3.180.0050.01316.26
7.3.170.0030.01416.68
7.3.160.0110.00716.46
7.3.120.0010.01514.84
7.3.110.0070.01114.89
7.3.100.0040.01114.75
7.3.90.0000.01314.48
7.3.80.0030.01414.81
7.3.70.0070.00314.61
7.3.60.0130.00314.61
7.3.50.0120.00314.59
7.3.40.0060.00914.70
7.3.30.0070.00714.98
7.3.20.0090.00316.80
7.3.10.0070.00716.67
7.3.00.0030.01016.67
7.2.330.0130.01016.89
7.2.320.0150.00616.88
7.2.310.0200.00616.66
7.2.300.0090.00916.84
7.2.290.0120.00416.75
7.2.250.0080.01215.33
7.2.240.0080.01115.13
7.2.230.0080.00815.08
7.2.220.0100.00315.21
7.2.210.0070.01114.86
7.2.200.0000.01315.30
7.2.190.0060.00715.02
7.2.180.0060.00915.09
7.2.170.0040.00814.88
7.2.130.0040.00716.98
7.2.120.0070.00716.77
7.2.110.0100.00616.74
7.2.100.0040.01116.81
7.2.90.0060.00917.09
7.2.80.0080.00316.80
7.2.70.0090.00616.92
7.2.60.0040.00816.67
7.2.50.0090.00617.07
7.2.40.0070.00716.89
7.2.30.0060.00616.98
7.2.20.0070.01016.98
7.2.10.0140.00417.09
7.2.00.0050.01218.30
7.1.330.0070.00715.96
7.1.320.0100.00315.71
7.1.310.0030.01315.79
7.1.300.0120.00615.71
7.1.290.0110.00415.74
7.1.280.0080.00415.79
7.1.270.0070.00715.88
7.1.260.0000.00915.89
7.1.250.0110.00715.92
7.1.100.0100.00317.64
7.1.70.0000.01117.25
7.1.60.0120.00919.17
7.1.50.0130.01317.09
7.1.00.0030.07322.30
7.0.200.0040.00416.77
7.0.140.0070.06721.95
7.0.100.0170.04719.90
7.0.90.0100.04719.91
7.0.80.0070.06319.92
7.0.70.0170.05020.16
7.0.60.0170.07319.97
7.0.50.0130.05320.29
7.0.40.0030.07020.00
7.0.30.0130.07720.14
7.0.20.0030.07019.99
7.0.10.0000.05320.09
7.0.00.0070.08320.02
5.6.250.0070.04320.67
5.6.240.0170.06320.70
5.6.230.0030.05720.64
5.6.220.0130.07020.59
5.6.210.0100.05720.57
5.6.200.0070.04020.99
5.6.190.0000.09021.05
5.6.180.0070.04321.04
5.6.170.0030.06321.11
5.6.160.0130.05721.02
5.6.150.0070.08021.01
5.6.140.0070.04321.13
5.6.130.0030.06721.09
5.6.120.0130.07721.11
5.6.110.0130.08321.03
5.6.100.0030.08721.16
5.6.90.0130.07021.00
5.6.80.0030.04020.45
5.6.70.0070.07720.42
5.6.60.0100.04320.30
5.6.50.0070.04720.43
5.6.40.0100.03320.46
5.6.30.0030.07320.38
5.6.20.0070.03720.39
5.6.10.0030.08020.39
5.6.00.0070.06020.45
5.5.380.0100.07720.46
5.5.370.0000.09720.42
5.5.360.0100.05320.35
5.5.350.0030.07720.41
5.5.340.0100.07720.89
5.5.330.0070.04020.87
5.5.320.0030.07320.87
5.5.310.0030.05320.91
5.5.300.0030.06320.64
5.5.290.0070.04020.77
5.5.280.0100.06720.87
5.5.270.0000.08320.86
5.5.260.0000.05020.88
5.5.250.0070.07320.61
5.5.240.0000.06320.32
5.5.230.0000.08320.24
5.5.220.0070.03720.24
5.5.210.0030.03720.25
5.5.200.0170.07720.25
5.5.190.0030.05320.13
5.5.180.0170.06720.24
5.5.160.0030.03720.28
5.5.150.0070.07320.13
5.5.140.0100.07320.28
5.5.130.0070.04320.26
5.5.120.0000.04320.21
5.5.110.0000.04020.27
5.5.100.0000.06720.09
5.5.90.0100.04020.13
5.5.80.0000.06720.17
5.5.70.0030.04020.19
5.5.60.0100.03320.10
5.5.50.0130.07019.96
5.5.40.0000.07720.15
5.5.30.0100.03019.95
5.5.20.0100.03720.04
5.5.10.0070.05020.01
5.5.00.0030.04320.07
5.4.450.0000.05019.36
5.4.440.0130.04319.36
5.4.430.0100.07019.20
5.4.420.0170.03019.37
5.4.410.0070.08719.24
5.4.400.0070.07319.03
5.4.390.0100.03018.91
5.4.380.0000.05019.09
5.4.370.0000.04719.03
5.4.360.0070.05019.13
5.4.350.0030.05019.05
5.4.340.0100.08318.90
5.4.320.0070.04319.05
5.4.310.0070.07719.12
5.4.300.0070.05318.95
5.4.290.0000.06018.85
5.4.280.0030.05319.18
5.4.270.0070.03318.90
5.4.260.0070.04019.04
5.4.250.0200.05719.04
5.4.240.0030.03719.12
5.4.230.0030.06719.17
5.4.220.0070.04019.20
5.4.210.0100.05318.87
5.4.200.0070.05319.12
5.4.190.0030.07319.17
5.4.180.0100.05719.11
5.4.170.0030.05318.85
5.4.160.0100.05319.11
5.4.150.0070.04719.02
5.4.140.0000.04016.45
5.4.130.0100.04716.18
5.4.120.0100.06016.45
5.4.110.0100.06716.50
5.4.100.0070.08016.58
5.4.90.0100.06316.32
5.4.80.0170.02716.41
5.4.70.0100.04016.37
5.4.60.0030.03716.48
5.4.50.0130.02316.36
5.4.40.0030.07016.51
5.4.30.0070.06016.48
5.4.20.0000.03716.47
5.4.10.0000.04016.33
5.4.00.0030.04015.63
5.3.290.0100.05014.77
5.3.280.0070.05014.55
5.3.270.0130.03014.64
5.3.260.0000.04314.58
5.3.250.0100.03314.53
5.3.240.0100.07314.64
5.3.230.0100.06314.54
5.3.220.0030.06714.56
5.3.210.0000.04014.63
5.3.200.0000.05314.61
5.3.190.0070.07714.55
5.3.180.0070.06714.49
5.3.170.0100.05714.62
5.3.160.0000.04314.64
5.3.150.0030.04014.53
5.3.140.0070.03314.57
5.3.130.0070.06014.50
5.3.120.0100.04714.65
5.3.110.0000.06314.52
5.3.100.0130.02714.06
5.3.90.0030.05014.09
5.3.80.0030.03714.02
5.3.70.0100.04014.14
5.3.60.0030.03314.07
5.3.50.0030.06014.05
5.3.40.0070.06013.88
5.3.30.0130.03014.02
5.3.20.0030.03713.75
5.3.10.0030.04713.59
5.3.00.0030.03313.56
5.2.170.0070.05711.13
5.2.160.0030.03011.25
5.2.150.0170.05311.05
5.2.140.0030.05011.19
5.2.130.0030.03011.20
5.2.120.0030.05311.20
5.2.110.0070.05711.00
5.2.100.0130.03011.11
5.2.90.0070.02311.02
5.2.80.0070.05710.97
5.2.70.0070.03010.98
5.2.60.0030.03710.97
5.2.50.0000.03311.07
5.2.40.0070.02710.98
5.2.30.0100.02311.09
5.2.20.0000.03310.86
5.2.10.0030.03010.77
5.2.00.0030.02710.84
5.1.60.0000.02710.06
5.1.50.0000.03010.09
5.1.40.0000.02710.07
5.1.30.0000.02310.40
5.1.20.0030.02310.29
5.1.10.0000.02310.08
5.1.00.0000.02310.14
5.0.50.0000.0178.61
5.0.40.0000.0178.46
5.0.30.0000.0278.22
5.0.20.0030.0178.27
5.0.10.0030.0138.22
5.0.00.0030.0308.23
4.4.90.0070.0278.22
4.4.80.0000.0178.22
4.4.70.0030.0138.22
4.4.60.0000.0178.22
4.4.50.0000.0178.22
4.4.40.0030.0238.22
4.4.30.0000.0178.22
4.4.20.0000.0178.22
4.4.10.0030.0108.22
4.4.00.0000.0238.22
4.3.110.0030.0108.22
4.3.100.0000.0138.22
4.3.90.0000.0138.22
4.3.80.0000.0238.22
4.3.70.0000.0178.22
4.3.60.0000.0178.22
4.3.50.0000.0178.22
4.3.40.0000.0238.22
4.3.30.0030.0138.22
4.3.20.0030.0178.22
4.3.10.0030.0138.22
4.3.00.0030.0138.22

preferences:
48 ms | 401 KiB | 5 Q