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); // unset $value or can get strange bugs. //unset($value); foreach($dataContainer as $value); var_dump($dataContainer,$value);

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.0070.00718.81
8.3.50.0080.01322.05
8.3.40.0070.00718.59
8.3.30.0070.00718.54
8.3.20.0080.00018.90
8.3.10.0080.00020.85
8.3.00.0070.00423.52
8.2.180.0150.00316.50
8.2.170.0080.00822.96
8.2.160.0100.00320.39
8.2.150.0080.00024.18
8.2.140.0050.00224.66
8.2.130.0050.00326.16
8.2.120.0000.00820.88
8.2.110.0060.00320.48
8.2.100.0070.00417.97
8.2.90.0050.00319.34
8.2.80.0030.00517.97
8.2.70.0000.00817.50
8.2.60.0040.00417.93
8.2.50.0000.00818.07
8.2.40.0030.00518.13
8.2.30.0020.00521.20
8.2.20.0040.00417.62
8.2.10.0050.00217.74
8.2.00.0000.00717.70
8.1.280.0110.00425.92
8.1.270.0020.00523.99
8.1.260.0040.00426.35
8.1.250.0000.00828.09
8.1.240.0120.00622.46
8.1.230.0060.00621.03
8.1.220.0030.00618.77
8.1.210.0030.00618.77
8.1.200.0000.00917.25
8.1.190.0000.00817.63
8.1.180.0000.00818.10
8.1.170.0030.00618.59
8.1.160.0050.00518.89
8.1.150.0050.00218.64
8.1.140.0040.00417.52
8.1.130.0030.00317.81
8.1.120.0040.00417.40
8.1.110.0080.00017.33
8.1.100.0070.00017.49
8.1.90.0000.00717.35
8.1.80.0050.00217.46
8.1.70.0040.00417.36
8.1.60.0030.00617.48
8.1.50.0040.00417.40
8.1.40.0030.00617.41
8.1.30.0040.00417.63
8.1.20.0000.00817.67
8.1.10.0080.00017.46
8.1.00.0030.00617.37
8.0.300.0100.00019.86
8.0.290.0070.00017.18
8.0.280.0030.00318.35
8.0.270.0030.00517.17
8.0.260.0050.00516.78
8.0.250.0030.00616.98
8.0.240.0070.00316.96
8.0.230.0030.00316.99
8.0.220.0070.00016.92
8.0.210.0060.00016.89
8.0.200.0000.00716.98
8.0.190.0020.00516.92
8.0.180.0000.00716.83
8.0.170.0070.00016.91
8.0.160.0000.00716.89
8.0.150.0040.00416.91
8.0.140.0080.00016.79
8.0.130.0000.00613.34
8.0.120.0040.00416.84
8.0.110.0080.00016.69
8.0.100.0040.00416.77
8.0.90.0000.00716.74
8.0.80.0030.01216.77
8.0.70.0000.00716.79
8.0.60.0040.00416.96
8.0.50.0000.00816.76
8.0.30.0150.00717.36
8.0.20.0150.00317.40
8.0.10.0040.00416.98
8.0.00.0080.01016.80
7.4.330.0050.00014.72
7.4.320.0000.00716.55
7.4.300.0030.00316.51
7.4.290.0000.00816.56
7.4.280.0050.00316.40
7.4.270.0070.00016.42
7.4.260.0060.00013.28
7.4.250.0060.00316.57
7.4.240.0030.00516.61
7.4.230.0030.00316.55
7.4.220.0090.01016.56
7.4.210.0090.00616.59
7.4.200.0000.00716.35
7.4.190.0050.00216.46
7.4.160.0120.00416.50
7.4.150.0130.00717.40
7.4.140.0090.01317.86
7.4.130.0080.00916.56
7.4.120.0100.00716.52
7.4.110.0110.00616.54
7.4.100.0060.01216.50
7.4.90.0100.01016.49
7.4.80.0000.01719.39
7.4.70.0040.01316.38
7.4.60.0120.00616.51
7.4.50.0060.00316.61
7.4.40.0080.00622.77
7.4.30.0070.01716.66
7.4.00.0070.00915.02
7.3.330.0000.00513.37
7.3.320.0050.00013.38
7.3.310.0070.00016.39
7.3.300.0070.00016.22
7.3.290.0030.01016.34
7.3.280.0070.00916.32
7.3.270.0160.00817.40
7.3.260.0100.00918.24
7.3.250.0080.01016.48
7.3.240.0100.00616.65
7.3.230.0070.01016.59
7.3.210.0090.00916.35
7.3.200.0100.01019.39
7.3.190.0140.00916.51
7.3.180.0110.00516.49
7.3.170.0030.01416.61
7.3.160.0060.01116.51
7.3.120.0050.01114.69
7.3.110.0070.01014.94
7.3.100.0070.00714.81
7.3.90.0000.01814.87
7.3.80.0070.00714.92
7.3.70.0060.00314.76
7.3.60.0030.00714.54
7.3.50.0080.00814.75
7.3.40.0040.01114.76
7.3.30.0070.00315.03
7.3.20.0000.01416.71
7.3.10.0090.00616.62
7.3.00.0000.01516.65
7.2.330.0070.01116.84
7.2.320.0150.00916.92
7.2.310.0040.01816.60
7.2.300.0110.00516.59
7.2.290.0070.00916.78
7.2.250.0070.01315.08
7.2.240.0110.00715.15
7.2.230.0070.01014.93
7.2.220.0060.00614.69
7.2.210.0030.00914.81
7.2.200.0040.01515.03
7.2.190.0100.00315.15
7.2.180.0000.01615.11
7.2.170.0070.00715.10
7.2.00.0040.01119.30
7.1.330.0140.00015.96
7.1.320.0090.00315.81
7.1.310.0040.00415.75
7.1.300.0080.00815.75
7.1.290.0070.00715.78
7.1.280.0070.00715.84
7.1.270.0030.01015.80
7.1.260.0000.00915.68
7.1.200.0050.00515.82
7.1.100.0000.01417.71
7.1.70.0100.00717.18
7.1.60.0060.01619.40
7.1.50.0130.01016.93
7.1.00.0100.04322.44
7.0.200.0050.00316.46
7.0.140.0100.06722.11
7.0.70.0030.05721.93
7.0.60.0000.07021.77
7.0.50.0030.08722.04
7.0.40.0100.06720.18
7.0.30.0000.09020.11
7.0.20.0030.05320.09
7.0.10.0030.08320.07
7.0.00.0070.04320.00
5.6.280.0070.07020.91
5.6.220.0030.08720.63
5.6.210.0000.08720.65
5.6.200.0070.08721.04
5.6.190.0030.05020.96
5.6.180.0000.08721.05
5.6.170.0030.06721.18
5.6.160.0030.08720.94
5.6.150.0000.08321.07
5.6.140.0100.06720.94
5.6.130.0030.08321.04
5.6.120.0070.08321.03
5.6.110.0070.05021.12
5.6.100.0070.06721.00
5.6.90.0070.08320.89
5.6.80.0070.07720.47
5.6.70.0070.08320.48
5.6.60.0030.06720.48
5.6.50.0030.08320.49
5.6.40.0030.08020.41
5.6.30.0000.07020.40
5.6.20.0030.06020.47
5.6.10.0030.07720.49
5.6.00.0030.07720.45
5.5.360.0070.08720.40
5.5.350.0070.08020.38
5.5.340.0030.07720.65
5.5.330.0030.08720.90
5.5.320.0030.08720.88
5.5.310.0130.07720.84
5.5.300.0070.07720.79
5.5.290.0030.08720.71
5.5.280.0070.07720.89
5.5.270.0030.06720.92
5.5.260.0030.08020.77
5.5.250.0070.08020.65
5.5.240.0070.07720.30
5.5.230.0000.08020.25
5.5.220.0070.06720.27
5.5.210.0130.05320.25
5.5.200.0130.07320.00
5.5.190.0070.05320.22
5.5.180.0100.07720.11
5.5.160.0030.06319.96
5.5.150.0030.08020.12
5.5.140.0070.07720.28
5.5.130.0100.05320.27
5.5.120.0000.08020.23
5.5.110.0200.07020.23
5.5.100.0070.08020.14
5.5.90.0100.07320.13
5.5.80.0100.07020.06
5.5.70.0030.06720.16
5.5.60.0100.07020.07
5.5.50.0030.07320.08
5.5.40.0000.05020.03
5.5.30.0030.06319.95
5.5.20.0030.06020.14
5.5.10.0030.04320.02
5.5.00.0070.08019.98
5.4.450.0000.06019.54
5.4.440.0070.08319.20
5.4.430.0030.08019.37
5.4.420.0170.06719.50
5.4.410.0030.08019.32
5.4.400.0100.06019.13
5.4.390.0030.08319.04
5.4.380.0070.07719.04
5.4.370.0030.08019.18
5.4.360.0070.07719.16
5.4.350.0030.07719.13
5.4.340.0000.08719.04
5.4.320.0070.07019.21
5.4.310.0000.04319.16
5.4.300.0030.07719.03
5.4.290.0070.07718.87
5.4.280.0030.08319.03
5.4.270.0000.07719.04
5.4.260.0000.07319.09
5.4.250.0030.06719.19
5.4.240.0100.06019.22
5.4.230.0000.08019.08
5.4.220.0100.07319.20
5.4.210.0070.07019.02
5.4.200.0070.07719.20
5.4.190.0070.07319.17
5.4.180.0000.04319.04
5.4.170.0070.04718.89
5.4.160.0130.07019.23
5.4.150.0170.07319.02
5.4.140.0000.07716.41
5.4.130.0070.06716.45
5.4.120.0070.07016.45
5.4.110.0070.04716.35
5.4.100.0100.06016.39
5.4.90.0070.05716.44
5.4.80.0000.05716.47
5.4.70.0070.07016.48
5.4.60.0030.05316.25
5.4.50.0130.05716.33
5.4.40.0030.07316.51
5.4.30.0070.07016.36
5.4.20.0070.06016.36
5.4.10.0000.05716.42
5.4.00.0100.04015.86
5.3.290.0030.06314.69
5.3.280.0030.07714.73
5.3.270.0070.04714.54
5.3.260.0000.06014.75
5.3.250.0000.06314.56
5.3.240.0100.05314.64
5.3.230.0000.08314.72
5.3.220.0030.05714.53
5.3.210.0070.06714.52
5.3.200.0030.05314.49
5.3.190.0000.08014.50
5.3.180.0100.07014.60
5.3.170.0030.06714.55
5.3.160.0000.07314.59
5.3.150.0070.07314.70
5.3.140.0000.06714.57
5.3.130.0000.08714.52
5.3.120.0070.06314.62
5.3.110.0000.07014.61
5.3.100.0070.04314.13
5.3.90.0030.06713.95
5.3.80.0070.05014.16
5.3.70.0030.07313.91
5.3.60.0030.07314.02
5.3.50.0030.07314.00
5.3.40.0070.07014.09
5.3.30.0100.06713.91
5.3.20.0070.05013.74
5.3.10.0000.05313.70
5.3.00.0170.05313.70
5.2.170.0030.05712.34
5.2.160.0070.05312.34
5.2.150.0070.04712.34
5.2.140.0030.04012.34
5.2.130.0030.06012.34
5.2.120.0030.04012.34
5.2.110.0100.03312.34
5.2.100.0030.06312.34
5.2.90.0070.04712.34
5.2.80.0030.04712.34
5.2.70.0030.04012.34
5.2.60.0030.05712.34
5.2.50.0030.05012.34
5.2.40.0070.04312.34
5.2.30.0030.05712.34
5.2.20.0030.06312.34
5.2.10.0000.05012.34
5.2.00.0030.06012.34
5.1.60.0030.05012.34
5.1.50.0000.05712.34
5.1.40.0000.05312.34
5.1.30.0070.04712.34
5.1.20.0030.06012.34
5.1.10.0030.05712.34
5.1.00.0000.05312.34
5.0.50.0000.02312.34
5.0.40.0070.03712.34
5.0.30.0000.07012.34
5.0.20.0100.04012.34
5.0.10.0000.03312.34
5.0.00.0030.04712.34
4.4.90.0000.01712.34
4.4.80.0000.02712.34
4.4.70.0030.03312.34
4.4.60.0000.03712.34
4.4.50.0000.03012.34
4.4.40.0030.03312.34
4.4.30.0000.03712.34
4.4.20.0070.02712.34
4.4.10.0000.03712.34
4.4.00.0000.02712.34
4.3.110.0070.02712.34
4.3.100.0030.02312.34
4.3.90.0000.02712.34
4.3.80.0000.03012.34
4.3.70.0070.03012.34
4.3.60.0000.03712.34
4.3.50.0030.03312.34
4.3.40.0000.04312.34
4.3.30.0000.03712.34
4.3.20.0000.03712.34
4.3.10.0000.04012.34
4.3.00.0000.03312.34

preferences:
49.3 ms | 401 KiB | 5 Q