3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo implements \IteratorAggregate, \ArrayAccess, \Countable { private $data = [1,2,3]; public function getIterator() { return new \ArrayIterator($this->data); } public function count() { return count($this->data); } public function offsetExists($offset) { return isset($this->data[$offset]); } public function offsetGet($offset) { return $this->data[$offset]; } public function offsetSet($offset, $value) { $this->data[$offset] = $value; } public function offsetUnset($offset) { unset($this->data[$offset]); } } foreach ((new \ArrayObject(new Foo)) as $key => $value) { var_dump($key, $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.70.0110.01116.75
8.3.60.0030.01016.50
8.3.50.0070.01322.05
8.3.40.0140.00018.73
8.3.30.0090.01219.09
8.3.20.0100.00020.34
8.3.10.0030.00523.53
8.3.00.0080.00019.26
8.2.180.0140.00418.04
8.2.170.0080.00822.96
8.2.160.0150.00020.35
8.2.150.0090.00024.18
8.2.140.0030.00524.66
8.2.130.0050.00326.16
8.2.120.0090.00022.25
8.2.110.0000.00922.11
8.2.100.0050.01117.66
8.2.90.0000.00918.99
8.2.80.0050.00317.97
8.2.70.0030.00617.63
8.2.60.0000.00817.80
8.2.50.0050.00318.07
8.2.40.0030.00619.73
8.2.30.0000.00718.06
8.2.20.0000.00817.64
8.2.10.0060.00318.03
8.2.00.0000.00717.63
8.1.280.0030.01225.92
8.1.270.0050.00322.14
8.1.260.0040.00426.35
8.1.250.0070.00028.09
8.1.240.0060.00322.05
8.1.230.0060.00618.82
8.1.220.0000.00817.74
8.1.210.0040.00418.77
8.1.200.0060.00317.36
8.1.190.0000.00817.23
8.1.180.0070.00318.10
8.1.170.0090.00018.50
8.1.160.0040.00422.02
8.1.150.0060.00318.55
8.1.140.0040.00417.34
8.1.130.0030.00317.77
8.1.120.0040.00417.41
8.1.110.0080.00017.41
8.1.100.0000.00717.26
8.1.90.0000.00717.34
8.1.80.0070.00017.38
8.1.70.0040.00417.42
8.1.60.0000.00817.55
8.1.50.0080.00017.44
8.1.40.0040.00417.52
8.1.30.0030.00517.57
8.1.20.0070.00017.63
8.1.10.0070.00017.50
8.1.00.0000.00817.46
8.0.300.0040.00418.77
8.0.290.0030.00517.05
8.0.280.0070.00018.55
8.0.270.0000.00717.31
8.0.260.0040.00417.18
8.0.250.0070.00016.86
8.0.240.0050.00216.95
8.0.230.0070.00016.92
8.0.220.0000.00716.81
8.0.210.0070.00016.71
8.0.200.0050.00316.83
8.0.190.0040.00416.77
8.0.180.0000.00716.87
8.0.170.0040.00416.87
8.0.160.0070.00016.88
8.0.150.0070.00016.71
8.0.140.0030.00716.71
8.0.130.0000.00513.27
8.0.120.0050.00216.76
8.0.110.0020.00516.75
8.0.100.0000.00716.73
8.0.90.0070.00016.64
8.0.80.0160.00016.81
8.0.70.0080.00016.78
8.0.60.0040.00416.80
8.0.50.0000.00716.93
8.0.30.0060.01417.03
8.0.20.0090.00917.40
8.0.10.0040.00416.90
8.0.00.0060.01316.68
7.4.330.0050.00015.00
7.4.320.0060.00016.35
7.4.300.0070.00016.34
7.4.290.0000.00616.30
7.4.280.0000.00716.48
7.4.270.0030.00316.54
7.4.260.0030.00316.43
7.4.250.0030.00316.36
7.4.240.0050.00316.56
7.4.230.0000.00716.58
7.4.220.0100.01016.47
7.4.210.0100.00816.48
7.4.200.0040.00416.46
7.4.190.0080.00016.41
7.4.160.0120.00616.44
7.4.150.0080.00917.40
7.4.140.0110.00617.86
7.4.130.0140.00516.40
7.4.120.0050.01116.49
7.4.110.0090.01516.55
7.4.100.0090.00816.44
7.4.90.0080.00816.55
7.4.80.0060.01319.39
7.4.70.0080.00816.50
7.4.60.0090.00916.28
7.4.50.0000.00816.41
7.4.40.0090.00916.37
7.4.30.0090.00716.56
7.4.00.0080.00814.94
7.3.330.0000.00813.18
7.3.320.0060.00013.12
7.3.310.0050.00316.10
7.3.300.0040.00416.22
7.3.290.0090.01116.17
7.3.280.0110.00616.14
7.3.270.0100.00617.40
7.3.260.0100.00716.21
7.3.250.0140.00316.27
7.3.240.0050.01616.43
7.3.230.0140.00316.42
7.3.210.0080.00816.45
7.3.200.0120.00619.39
7.3.190.0100.01316.23
7.3.180.0060.01516.40
7.3.170.0120.00316.52
7.3.160.0120.00416.32
7.3.120.0070.01114.73
7.3.110.0020.01414.52
7.3.100.0060.00914.81
7.3.90.0070.00514.77
7.3.80.0090.00514.72
7.3.70.0050.01014.54
7.3.60.0020.01114.68
7.3.50.0020.01314.64
7.3.40.0030.01114.54
7.3.30.0050.00914.68
7.3.20.0050.00916.68
7.3.10.0030.00916.51
7.3.00.0060.00616.43
7.2.330.0090.00916.39
7.2.320.0030.01316.55
7.2.310.0110.00816.68
7.2.300.0080.00816.55
7.2.290.0030.01316.39
7.2.250.0120.00615.19
7.2.240.0060.01014.92
7.2.230.0080.00715.02
7.2.220.0080.00714.77
7.2.210.0060.01114.94
7.2.200.0040.01114.83
7.2.190.0080.00814.99
7.2.180.0070.00614.85
7.2.170.0040.01114.95
7.2.160.0100.00314.79
7.2.150.0000.01416.66
7.2.140.0100.00616.89
7.2.130.0100.00416.91
7.2.120.0050.00817.06
7.2.110.0040.00916.87
7.2.100.0090.00716.86
7.2.90.0040.00916.79
7.2.80.0030.00916.72
7.2.70.0050.00816.60
7.2.60.0070.00516.81
7.2.50.0080.00816.87
7.2.40.0070.00716.91
7.2.30.0050.00616.89
7.2.20.0020.01016.92
7.2.10.0050.00717.00
7.2.00.0060.00817.62
7.1.330.0020.01515.66
7.1.320.0070.00515.77
7.1.310.0050.00815.67
7.1.300.0040.00615.63
7.1.290.0060.00715.67
7.1.280.0040.00815.60
7.1.270.0070.00515.63
7.1.260.0090.00715.55
7.1.250.0050.00815.46
7.1.240.0060.00315.68
7.1.230.0000.00715.46
7.1.220.0070.00315.60
7.1.210.0040.00815.70
7.1.200.0050.00515.85
7.1.190.0040.01115.54
7.1.180.0050.00215.66
7.1.170.0070.00315.49
7.1.160.0060.00315.87
7.1.150.0060.00315.46
7.1.140.0050.00515.75
7.1.130.0000.00815.60
7.1.120.0040.00815.39
7.1.110.0000.01415.51
7.1.100.0030.00816.73
7.1.90.0060.00315.73
7.1.80.0040.00715.70
7.1.70.0030.00916.22
7.1.60.0080.00817.45
7.1.50.0040.01416.28
7.1.40.0040.00415.43
7.1.30.0030.00815.84
7.1.20.0060.00615.38
7.1.10.0090.00315.59
7.1.00.0030.04118.97
7.0.330.0000.01215.35
7.0.320.0040.00715.18
7.0.310.0050.00515.27
7.0.300.0090.00615.21
7.0.290.0040.00814.95
7.0.280.0000.00815.07
7.0.270.0040.00415.18
7.0.260.0030.01014.85
7.0.250.0060.00614.99
7.0.240.0040.00815.48
7.0.230.0030.00615.30
7.0.220.0060.00615.41
7.0.210.0040.00815.35
7.0.200.0010.00715.99
7.0.190.0030.00515.15
7.0.180.0040.00815.31
7.0.170.0100.00015.36
7.0.160.0040.00715.24
7.0.150.0040.00815.07
7.0.140.0080.03718.68
7.0.130.0060.00315.12
7.0.120.0110.00015.39
7.0.110.0080.00415.06
7.0.100.0040.00415.05
7.0.90.0060.00915.31
7.0.80.0000.01215.39
7.0.70.0040.00714.99
7.0.60.0030.04217.57
7.0.50.0040.02416.44
7.0.40.0050.02316.62
7.0.30.0180.02516.78
7.0.20.0130.02616.71
7.0.10.0080.02416.74
7.0.00.0100.01816.68
5.6.380.0030.00914.02
5.6.370.0100.00014.16
5.6.360.0070.00714.23
5.6.350.0000.00714.44
5.6.340.0030.01014.34
5.6.330.0040.01114.30
5.6.320.0030.00614.16
5.6.310.0040.01114.17
5.6.300.0080.00314.41
5.6.290.0000.00913.84
5.6.280.0050.03717.43
5.6.270.0040.00414.11
5.6.260.0040.00413.87
5.6.250.0000.01314.04
5.6.240.0000.00814.33
5.6.230.0060.00313.97
5.6.220.0030.00614.14
5.6.210.0100.01817.31
5.6.200.0020.02916.08
5.6.190.0060.02317.32
5.6.180.2030.02217.46
5.6.170.0100.02417.17
5.6.160.0030.04317.15
5.6.150.0060.03916.22
5.6.140.0020.02516.07
5.6.130.0040.02516.02
5.6.120.0100.04217.57
5.6.110.0050.02617.54
5.6.100.0040.03217.47
5.6.90.0090.04317.56
5.6.80.0060.02017.09
5.6.70.0140.04117.21
5.6.60.0000.01113.78
5.6.50.0030.00714.02
5.6.40.0060.00613.54
5.6.30.0060.00614.06
5.6.20.0070.00714.03
5.6.10.0060.00313.83
5.6.00.0030.00613.80
5.5.380.0030.00511.09
5.5.370.0060.00311.25
5.5.360.0080.00311.00
5.5.350.0160.03415.74
5.5.340.0000.03414.62
5.5.330.0040.02515.60
5.5.320.0250.02315.69
5.5.310.0100.02715.75
5.5.300.0030.02514.50
5.5.290.0030.02714.50
5.5.280.0050.02515.98
5.5.270.0260.02315.95
5.5.260.0060.04615.88
5.5.250.0040.02815.83
5.5.240.0030.04215.58
5.5.230.0030.00511.00
5.5.220.0080.00011.00
5.5.210.0070.00311.04
5.5.200.0040.00811.21
5.5.190.0040.00411.00
5.5.180.0050.00511.00
5.5.170.0000.00911.00
5.5.160.0000.00711.04
5.5.150.0000.00711.00
5.5.140.0040.00311.00
5.5.130.0000.00711.00
5.5.120.0030.00311.00
5.5.110.0000.00711.07
5.5.100.0070.00011.00
5.5.90.0050.00211.00
5.5.80.0070.00011.00
5.5.70.0030.00311.10
5.5.60.0050.00211.00
5.5.50.0080.00311.14
5.5.40.0000.00611.04
5.5.30.0050.00311.10
5.5.20.0060.00311.11
5.5.10.0040.00411.00
5.5.00.0050.00311.18
5.4.450.0120.03515.37
5.4.440.0350.02515.25
5.4.430.0480.02815.24
5.4.420.0380.00215.33
5.4.410.0060.02814.98
5.4.400.0180.03214.88
5.4.390.0080.03214.85
5.4.380.0150.03414.98
5.4.370.0050.02514.88
5.4.360.0050.02014.93
5.4.350.0060.02111.52
5.4.340.0020.02511.51
5.4.330.0030.00611.00
5.4.320.0050.02011.76
5.4.310.0060.02211.75
5.4.300.0040.02211.76
5.4.290.0040.02311.75
5.4.280.0040.02411.72
5.4.270.0040.03011.85
5.4.260.0050.02911.70
5.4.250.0040.03311.71
5.4.240.0060.02511.70
5.4.230.0070.02311.74
5.4.220.0020.02511.70
5.4.210.0070.02011.70
5.4.200.0060.02111.70
5.4.190.0060.02511.70
5.4.180.0070.01911.70
5.4.170.0040.02111.73
5.4.160.0050.02311.70
5.4.150.0060.02211.70
5.4.140.0090.03111.56
5.4.130.0090.02711.54
5.4.120.0080.02711.61
5.4.110.0050.02311.51
5.4.100.0050.03011.51
5.4.90.0070.02311.51
5.4.80.0060.02211.51
5.4.70.0050.02411.51
5.4.60.0020.02711.51
5.4.50.0060.02111.51
5.4.40.0050.02811.50
5.4.30.0040.02011.50
5.4.20.0070.02211.50
5.4.10.0090.02211.50
5.4.00.0050.02911.24
5.3.290.0040.02411.90
5.3.280.0090.02611.86
5.3.270.0080.02111.86
5.3.260.0040.02511.86
5.3.250.0020.02511.86
5.3.240.0060.02211.86
5.3.230.0060.02411.86
5.3.220.0080.03411.84
5.3.210.0080.03111.84
5.3.200.0060.03311.84
5.3.190.0080.03411.84
5.3.180.0070.03311.84
5.3.170.0090.02911.84
5.3.160.0120.03611.84
5.3.150.0080.02411.84
5.3.140.0050.02311.83
5.3.130.0030.02311.83
5.3.120.0030.02311.83
5.3.110.0080.02311.83
5.3.100.0040.02411.57
5.3.90.0040.02111.56
5.3.80.0040.02711.55
5.3.70.0050.02211.55
5.3.60.0050.02111.55
5.3.50.0100.01911.52
5.3.40.0070.02911.52
5.3.30.0050.03311.50
5.3.20.0110.02611.39
5.3.10.0080.02411.37
5.3.00.0080.03311.37
5.2.170.0040.03010.11
5.2.160.0050.01910.11
5.2.150.0040.01910.11
5.2.140.0040.01810.11
5.2.130.0060.01810.09
5.2.120.0040.02310.09
5.2.110.0070.01610.09
5.2.100.0060.01810.09
5.2.90.0050.02210.09
5.2.80.0060.02410.09
5.2.70.0070.02410.09
5.2.60.0040.02910.06
5.2.50.0070.01810.05
5.2.40.0050.01810.04
5.2.30.0060.02310.03
5.2.20.0080.02110.02
5.2.10.0050.0219.97
5.2.00.0060.0229.90
5.1.60.0070.0239.55
5.1.50.0040.0189.54
5.1.40.0100.0229.53
5.1.30.0060.0229.71
5.1.20.0080.0259.72
5.1.10.0040.0289.58
5.1.00.0060.0209.58
5.0.50.0060.0288.82
5.0.40.0060.0158.75
5.0.30.0050.0268.65
5.0.20.0060.0198.64
5.0.10.0040.0168.63
5.0.00.0040.0218.63
4.4.90.0110.0147.89
4.4.80.0050.0127.88
4.4.70.0040.0287.88
4.4.60.0040.0137.88
4.4.50.0020.0157.89
4.4.40.0010.0217.86
4.4.30.0050.0117.88
4.4.20.0040.0107.93
4.4.10.0040.0107.93
4.4.00.0030.0147.88
4.3.110.0020.0087.84
4.3.100.0030.0087.83
4.3.90.0030.0087.82
4.3.80.0030.0137.79
4.3.70.0010.0107.82
4.3.60.0060.0107.82
4.3.50.0020.0117.82
4.3.40.0040.0167.77
4.3.30.0050.0207.15
4.3.20.0150.0297.14
4.3.10.0040.0117.12
4.3.00.0070.0148.82

preferences:
35.6 ms | 401 KiB | 5 Q