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() { static $times = 0; foreach ($this->data as &$value) { yield $value; } $times++; echo "getting ext iterator - $times\n"; } } $dataContainer = new DataContainer([77, 78, 79]); foreach ($dataContainer as &$value) { echo $value *= -1,"\n"; } //Must 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.0150.00416.61
8.3.50.0160.00917.58
8.3.40.0090.00618.70
8.3.30.0160.00318.67
8.3.20.0040.00418.90
8.3.10.0000.00820.36
8.3.00.0040.00419.13
8.2.180.0130.01016.63
8.2.170.0120.00922.96
8.2.160.0130.00320.53
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0090.00026.16
8.2.120.0070.01021.18
8.2.110.0070.00320.16
8.2.100.0100.00717.72
8.2.90.0040.00419.41
8.2.80.0000.00817.97
8.2.70.0080.00017.63
8.2.60.0040.00417.92
8.2.50.0040.00418.10
8.2.40.0050.00320.65
8.2.30.0040.00418.18
8.2.20.0040.00517.59
8.2.10.0030.00517.66
8.2.00.0050.00317.63
8.1.280.0140.00325.92
8.1.270.0040.00423.99
8.1.260.0080.00026.35
8.1.250.0000.00828.09
8.1.240.0080.00022.74
8.1.230.0000.01117.95
8.1.220.0000.00917.74
8.1.210.0030.00618.77
8.1.200.0090.00017.25
8.1.190.0000.00817.22
8.1.180.0000.00918.10
8.1.170.0040.00418.50
8.1.160.0040.00422.14
8.1.150.0070.00218.64
8.1.140.0050.00217.34
8.1.130.0000.00717.88
8.1.120.0040.00417.44
8.1.110.0060.00617.47
8.1.100.0000.00717.50
8.1.90.0040.00417.49
8.1.80.0050.00217.50
8.1.70.0000.00717.45
8.1.60.0000.01017.54
8.1.50.0040.00417.47
8.1.40.0080.00017.44
8.1.30.0030.00617.67
8.1.20.0030.00517.67
8.1.10.0040.00417.50
8.1.00.0000.00717.41
8.0.300.0070.00018.77
8.0.290.0080.00016.75
8.0.280.0030.00318.37
8.0.270.0050.00217.27
8.0.260.0030.00316.88
8.0.250.0070.00016.95
8.0.240.0060.00317.00
8.0.230.0070.00016.89
8.0.220.0000.00716.75
8.0.210.0000.00716.95
8.0.200.0000.00616.83
8.0.190.0000.00717.01
8.0.180.0080.00016.82
8.0.170.0030.00616.84
8.0.160.0050.00316.91
8.0.150.0040.00416.86
8.0.140.0070.00316.86
8.0.130.0000.00613.40
8.0.120.0000.00816.84
8.0.110.0040.00416.85
8.0.100.0050.00216.85
8.0.90.0000.00716.92
8.0.80.0130.00916.90
8.0.70.0040.00416.97
8.0.60.0000.00816.74
8.0.50.0000.00716.85
8.0.30.0160.01017.12
8.0.20.0160.00317.08
8.0.10.0000.00716.91
8.0.00.0110.01316.65
7.4.330.0000.00513.04
7.4.320.0000.00616.59
7.4.300.0030.00316.59
7.4.290.0070.00016.66
7.4.280.0000.00816.54
7.4.270.0030.00316.47
7.4.260.0030.00313.32
7.4.250.0080.00016.60
7.4.240.0000.00816.54
7.4.230.0000.00716.41
7.4.220.0110.01416.62
7.4.210.0100.01016.48
7.4.200.0070.00016.54
7.4.190.0000.00716.57
7.4.160.0100.01016.49
7.4.150.0170.00716.53
7.4.140.0040.01316.30
7.4.130.0090.01216.66
7.4.120.0160.00616.54
7.4.110.0100.01016.67
7.4.100.0070.01016.61
7.4.90.0220.00316.50
7.4.80.0100.00719.39
7.4.70.0060.01216.34
7.4.60.0120.00416.45
7.4.50.0000.00716.59
7.4.40.0030.00916.41
7.4.30.0070.01016.67
7.4.00.0030.01315.01
7.3.330.0070.00013.23
7.3.320.0000.00713.21
7.3.310.0030.00316.38
7.3.300.0000.00716.41
7.3.290.0080.00916.34
7.3.280.0070.00816.32
7.3.270.0180.00016.51
7.3.260.0060.01216.41
7.3.250.0110.00716.39
7.3.240.0150.01216.67
7.3.230.0030.01416.55
7.3.210.0100.00716.52
7.3.200.0130.00616.56
7.3.190.0050.01116.56
7.3.180.0030.01516.58
7.3.170.0060.00916.55
7.3.160.0070.01016.66
7.3.120.0030.01015.15
7.3.10.0060.00916.55
7.3.00.0000.00916.68
7.2.330.0030.01516.74
7.2.320.0070.01016.74
7.2.310.0140.00616.53
7.2.300.0040.01216.81
7.2.290.0030.01416.59
7.2.130.0070.00417.15
7.2.120.0030.01016.88
7.2.110.0030.01016.71
7.2.100.0000.01217.01
7.2.90.0000.01117.02
7.2.80.0030.01016.84
7.2.70.0120.00416.97
7.2.60.0050.00916.85
7.2.50.0030.00917.07
7.2.40.0030.00716.73
7.2.30.0060.00916.80
7.2.20.0070.00416.87
7.2.10.0000.01017.08
7.2.00.0050.00818.09
7.1.250.0060.00915.98
7.1.200.0030.00915.92
7.1.70.0000.00717.27
7.1.60.0030.01317.38
7.1.50.0100.00017.04
7.1.40.0040.00816.75
7.1.30.0090.00916.75
7.1.20.0060.00616.75
7.1.10.0050.00316.75
7.1.00.0000.01116.78
7.0.200.0040.00416.85
7.0.190.0000.00816.82
7.0.180.0050.00316.75
7.0.170.0100.00016.75
7.0.160.0040.00416.75
7.0.150.0000.00716.75
7.0.140.0040.00416.75
7.0.130.0050.00216.75
7.0.120.0000.00716.75
7.0.110.0050.00216.75
7.0.100.0000.00816.75
7.0.90.0040.00416.75
7.0.80.0040.00416.75
7.0.70.0110.00416.75
7.0.60.0030.00816.75
7.0.50.0090.00016.75
7.0.40.0060.00316.75
7.0.30.0000.00716.75
7.0.20.0000.01116.75
7.0.10.0050.00516.75
7.0.00.0000.01116.75
5.6.300.0070.06020.68
5.6.290.0130.04420.58
5.6.280.0030.04620.86
5.6.270.0060.04121.03
5.6.260.0260.03621.04
5.6.250.0030.04421.05
5.6.240.0030.04820.84
5.6.230.0030.04820.85
5.6.220.0070.04620.82
5.6.210.0030.04820.63
5.6.200.0030.04621.00
5.6.190.0030.05120.83
5.6.180.0230.05621.06
5.6.170.0070.03620.73
5.6.160.0000.05020.93
5.6.150.0100.03521.03
5.6.140.0000.05020.98
5.6.130.0030.04420.73
5.6.120.0100.04420.82
5.6.110.0030.04620.98
5.6.100.0030.04920.81
5.6.90.0170.04020.94
5.6.80.0070.04020.21
5.6.70.0070.04120.23
5.6.60.0040.05220.14
5.6.50.0100.06020.12
5.6.40.0400.03320.35
5.6.30.0100.03820.14
5.6.20.0100.03820.27
5.6.10.0070.04120.19
5.6.00.0070.03920.17
5.5.380.0100.03517.63
5.5.370.0030.04017.53
5.5.360.0030.04517.54
5.5.350.0030.04217.64
5.5.340.0230.04617.73
5.5.330.0000.04318.10
5.5.320.0070.04218.03
5.5.310.0070.04618.10
5.5.300.0030.04318.06
5.5.290.0070.04018.02
5.5.280.0030.04418.14
5.5.270.0070.04018.02
5.5.260.0070.04018.07
5.5.250.0000.05117.50
5.5.240.0030.04717.40
5.5.230.0070.03917.10
5.5.220.0060.03617.42
5.5.210.0070.03517.08
5.5.200.0030.03617.41
5.5.190.0030.04417.07
5.5.180.0000.04117.18
5.5.160.0000.04517.43
5.5.150.0030.03717.50
5.5.140.0100.03117.33
5.5.130.0030.04017.41
5.5.120.0030.03717.41
5.5.110.0030.04217.40
5.5.100.0030.04117.23
5.5.90.0060.05217.33
5.5.80.0030.07717.07
5.5.70.0030.03817.35
5.5.60.0030.04017.06
5.5.50.0100.03317.32
5.5.40.0030.04017.26
5.5.30.0160.03917.23
5.5.20.0070.05017.26
5.5.10.0030.03817.30
5.5.00.0070.08816.91
5.4.450.0100.03719.38
5.4.440.0070.03619.38
5.4.430.0030.03819.50
5.4.420.0030.04019.25
5.4.410.0100.03719.13
5.4.400.0100.03319.19
5.4.390.0000.04618.96
5.4.380.0000.04619.03
5.4.370.0000.04318.95
5.4.360.0070.04619.09
5.4.350.0030.03619.03
5.4.340.0030.04019.11
5.4.320.0060.03818.96
5.4.310.0030.03719.03
5.4.300.0030.03718.88
5.4.290.0070.03619.18
5.4.280.0030.04618.92
5.4.270.0040.03519.11
5.4.260.0000.04318.92
5.4.250.0030.04119.11
5.4.240.0030.03919.11
5.4.230.0030.04318.95
5.4.220.0060.03819.17
5.4.210.0070.03819.06
5.4.200.0130.04319.02
5.4.190.0030.04218.91
5.4.180.0130.04519.11
5.4.170.0070.03719.20
5.4.160.0030.05418.85
5.4.150.0070.03719.09
5.4.140.0060.06816.75
5.4.130.0000.07916.75
5.4.120.0000.04016.75
5.4.110.0030.03916.75
5.4.100.0030.04716.75
5.4.90.0070.07316.75
5.4.80.0030.03716.75
5.4.70.0030.03416.75
5.4.60.0100.03016.75
5.4.50.0030.03816.75
5.4.40.0030.04516.75
5.4.30.0260.02616.75
5.4.20.0030.03416.75
5.4.10.0000.04016.75
5.4.00.0270.03416.75
5.3.290.0000.04016.75
5.3.280.0030.03916.75
5.3.270.0000.04616.75
5.3.260.0000.04316.75
5.3.250.0060.03916.75
5.3.240.0030.03816.75
5.3.230.0030.05316.75
5.3.220.0030.03516.75
5.3.210.0030.03616.75
5.3.200.0070.03616.75
5.3.190.0000.05016.75
5.3.180.0030.03516.75
5.3.170.0070.04016.75
5.3.160.0030.04016.75
5.3.150.0000.04216.75
5.3.140.0030.03916.75
5.3.130.0070.06616.75
5.3.120.0070.03616.75
5.3.110.0030.03516.75
5.3.100.0070.03116.75
5.3.90.0070.03016.75
5.3.80.0000.03716.75
5.3.70.0030.03516.75
5.3.60.0030.03616.75
5.3.50.0030.07016.75
5.3.40.0000.04616.75
5.3.30.0030.03816.75
5.3.20.0030.04716.75
5.3.10.0070.03416.75
5.3.00.0030.03316.75
5.2.170.0030.06316.75
5.2.160.0000.06416.75
5.2.150.0000.03416.75
5.2.140.0000.03516.75
5.2.130.0060.03116.75
5.2.120.0000.03416.75
5.2.110.0030.02716.75
5.2.100.0030.02716.75
5.2.90.0070.02316.75
5.2.80.0000.03316.75
5.2.70.0000.03016.75
5.2.60.0030.02716.75
5.2.50.0030.02716.75
5.2.40.0070.02816.75
5.2.30.0030.02916.75
5.2.20.0030.02716.75
5.2.10.0030.02616.75
5.2.00.0000.03216.75
5.1.60.0030.02516.75
5.1.50.0000.02616.75
5.1.40.0030.02616.75
5.1.30.0030.02816.75
5.1.20.0030.05116.75
5.1.10.0000.04516.75
5.1.00.0100.02416.75
5.0.50.0000.02216.75
5.0.40.0140.01716.75
5.0.30.0040.03316.75
5.0.20.0030.01916.75
5.0.10.0060.02216.75
5.0.00.0080.02816.75
4.4.90.0000.01616.75
4.4.80.0030.01316.75
4.4.70.0030.01416.75
4.4.60.0040.01416.75
4.4.50.0030.01316.75
4.4.40.0000.02616.75
4.4.30.0000.01816.75
4.4.20.0000.01916.75
4.4.10.0040.01416.75
4.4.00.0030.02416.75
4.3.110.0000.01816.75
4.3.100.0030.01316.75
4.3.90.0060.00916.75
4.3.80.0030.02316.75
4.3.70.0000.03016.75
4.3.60.0000.02116.75
4.3.50.0030.02416.75
4.3.40.0030.02916.75
4.3.30.0070.01116.75
4.3.20.0030.01616.75
4.3.10.0030.01716.75
4.3.00.0070.01016.75

preferences:
49.51 ms | 400 KiB | 5 Q