3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo implements ArrayAccess { protected $_values = ["bar" => 1]; public function offsetExists($offset) { return array_key_exists($offset, $this->_values); } public function offsetGet($offset) { return $this->offsetExists($offset) ? $this->_values[$offset]:NULL; } public function offsetSet($offset, $value) { $this->_values[$offset] = $value; } public function offsetUnset($offset) { if ($this->offsetExists($offset)) { unset($this->_values[$offset]); } } } $a = new Foo(); foreach ($a as $key => $value) { echo "key: $key, value: $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.4.10.0090.00019.59
8.3.140.0080.00016.91
8.3.130.0040.00816.63
8.3.120.0060.00320.68
8.3.110.0060.00620.94
8.3.100.0070.00316.76
8.3.90.0140.00726.77
8.3.80.0080.00316.65
8.3.70.0190.00016.63
8.3.60.0040.01116.63
8.3.50.0100.01121.98
8.3.40.0080.00818.67
8.3.30.0120.00318.73
8.3.20.0040.00420.16
8.3.10.0080.00023.66
8.3.00.0040.00422.45
8.2.250.0030.00518.70
8.2.240.0030.00617.05
8.2.230.0030.00622.58
8.2.220.0100.00724.06
8.2.210.0160.00326.77
8.2.200.0040.00416.63
8.2.190.0100.01016.75
8.2.180.0090.00618.29
8.2.170.0140.00022.96
8.2.160.0100.00319.32
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0050.00221.02
8.2.110.0060.00321.00
8.2.100.0120.00017.91
8.2.90.0000.00818.09
8.2.80.0040.00418.98
8.2.70.0000.00817.63
8.2.60.0030.00518.04
8.2.50.0050.00318.10
8.2.40.0080.00020.52
8.2.30.0000.00719.12
8.2.20.0080.00017.72
8.2.10.0060.00318.11
8.2.00.0000.00917.73
8.1.300.0100.01320.10
8.1.290.0120.00030.84
8.1.280.0090.00925.92
8.1.270.0000.00723.99
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0060.00321.15
8.1.230.0030.00820.95
8.1.220.0040.00417.74
8.1.210.0000.00818.77
8.1.200.0040.00417.22
8.1.190.0080.00019.01
8.1.180.0040.00418.10
8.1.170.0000.00818.70
8.1.160.0000.00822.21
8.1.150.0000.00718.80
8.1.140.0000.00719.55
8.1.130.0030.00317.80
8.1.120.0060.00317.50
8.1.110.0040.00417.38
8.1.100.0000.00717.33
8.1.90.0040.00417.40
8.1.80.0030.00317.39
8.1.70.0030.00717.41
8.1.60.0040.00417.61
8.1.50.0000.00817.48
8.1.40.0030.00717.41
8.1.30.0000.00817.54
8.1.20.0040.00417.64
8.1.10.0030.00617.51
8.1.00.0060.00317.43
8.0.300.0040.00419.95
8.0.290.0040.00416.62
8.0.280.0000.00718.50
8.0.270.0040.00416.81
8.0.260.0000.00617.28
8.0.250.0000.00616.95
8.0.240.0000.00716.88
8.0.230.0030.00716.86
8.0.220.0000.00916.91
8.0.210.0060.00016.79
8.0.200.0070.00016.96
8.0.190.0000.00816.98
8.0.180.0040.00716.92
8.0.170.0000.00716.90
8.0.160.0030.00316.86
8.0.150.0110.00016.68
8.0.140.0040.00416.74
8.0.130.0000.00513.27
8.0.120.0050.00316.78
8.0.110.0000.00716.82
8.0.100.0000.00816.81
8.0.90.0000.00716.88
8.0.80.0040.01116.91
8.0.70.0030.00516.88
8.0.60.0050.00216.91
8.0.50.0040.00416.75
8.0.30.0100.00917.14
8.0.20.0130.00817.40
8.0.10.0070.00017.06
8.0.00.0100.00716.55
7.4.330.0000.00515.08
7.4.320.0060.00016.49
7.4.300.0000.00616.51
7.4.290.0050.00316.63
7.4.280.0000.01016.52
7.4.270.0050.00316.40
7.4.260.0030.00316.41
7.4.250.0070.00016.50
7.4.240.0030.00616.23
7.4.230.0000.00716.61
7.4.220.0040.01516.65
7.4.210.0030.01316.64
7.4.200.0000.00616.57
7.4.160.0050.01016.45
7.4.150.0140.00317.40
7.4.140.0080.01017.86
7.4.130.0090.00916.60
7.4.120.0090.01016.41
7.4.110.0070.01016.51
7.4.100.0130.00416.40
7.4.90.0080.00816.54
7.4.80.0060.01119.39
7.4.70.0160.00616.55
7.4.60.0080.00816.54
7.4.50.0100.00716.44
7.4.40.0100.00616.30
7.4.30.0070.01016.41
7.4.00.0080.00914.81
7.3.330.0030.00313.16
7.3.320.0050.00013.24
7.3.310.0040.00416.18
7.3.300.0090.00016.36
7.3.290.0080.01016.33
7.3.280.0050.00916.29
7.3.270.0140.00317.40
7.3.260.0130.00516.55
7.3.250.0080.01216.41
7.3.240.0070.01116.38
7.3.230.0120.00416.73
7.3.210.0120.00616.32
7.3.200.0090.00616.38
7.3.190.0110.00516.56
7.3.180.0070.01016.62
7.3.170.0060.01016.55
7.3.160.0000.01516.50
7.3.120.0100.00614.68
7.3.110.0070.01014.63
7.3.100.0040.01114.71
7.3.90.0060.01214.68
7.3.80.0100.00514.66
7.3.70.0030.01314.81
7.3.60.0050.00714.73
7.3.50.0080.00814.75
7.3.40.0030.00914.78
7.3.30.0020.01414.85
7.3.20.0160.00515.81
7.3.10.0100.00815.78
7.3.00.0060.01215.50
7.2.330.0090.00916.70
7.2.320.0060.01016.46
7.2.310.0100.01316.61
7.2.300.0100.00716.66
7.2.290.0090.01316.59
7.2.250.0030.01015.05
7.2.240.0070.01115.24
7.2.230.0040.01115.22
7.2.220.0100.00715.16
7.2.210.0080.00315.07
7.2.200.0110.00615.06
7.2.190.0050.00915.10
7.2.180.0050.00715.03
7.2.170.0090.00615.00
7.2.160.0130.00415.13
7.2.150.0220.00615.07
7.2.140.0100.01314.98
7.2.130.0100.01015.02
7.2.120.0180.00714.95
7.2.110.0200.00314.96
7.2.100.0200.00315.16
7.2.90.0140.00714.85
7.2.80.0150.00314.98
7.2.70.0160.00714.89
7.2.60.0110.00915.93
7.2.50.0160.00415.23
7.2.40.0180.00415.01
7.2.30.0100.01015.18
7.2.20.0160.00414.95
7.2.10.0240.00015.07
7.2.00.0220.00617.20
7.1.330.0000.01415.85
7.1.320.0090.00615.80
7.1.310.0420.01014.94
7.1.300.0140.00514.95
7.1.290.0110.00614.87
7.1.280.0160.00414.85
7.1.270.0170.00514.75
7.1.260.0090.00514.74
7.1.250.0070.01013.95
7.1.240.0230.00913.81
7.1.230.0250.00614.04
7.1.220.0120.01513.69
7.1.210.0250.00313.94
7.1.200.0110.01014.92
7.1.190.0190.00913.98
7.1.180.0180.01213.80
7.1.170.0440.00314.12
7.1.160.0160.01213.75
7.1.150.0180.00413.86
7.1.140.0170.01013.79
7.1.130.0230.00313.97
7.1.120.0160.00413.97
7.1.110.0120.01213.68
7.1.100.0060.02213.97
7.1.90.0140.01113.95
7.1.80.0190.00613.88
7.1.70.0080.00715.31
7.1.60.0820.00615.50
7.1.50.0100.00715.26
7.1.40.0100.01015.33
7.1.30.0130.00815.45
7.1.20.0080.00815.24
7.1.10.0140.00015.34
7.1.00.0160.00115.36
7.0.330.0180.01213.57
7.0.320.0230.00313.52
7.0.310.0290.00413.55
7.0.300.0250.00413.38
7.0.290.0160.00413.36
7.0.280.0180.01113.56
7.0.270.0150.01213.56
7.0.260.0130.00913.27
7.0.250.0190.00413.64
7.0.240.0230.00613.62
7.0.230.0160.00513.59
7.0.220.0160.00813.31
7.0.210.0100.01013.52
7.0.200.0090.00315.13
7.0.190.0090.00515.19
7.0.180.0130.00615.04
7.0.170.0150.00615.24
7.0.160.0130.00615.19
7.0.150.0120.00415.17
7.0.140.0940.01015.14
7.0.130.0090.00715.02
7.0.120.0100.01015.18
7.0.110.0140.00415.18
7.0.100.0090.00915.15
7.0.90.0180.00315.11
7.0.80.0080.00815.15
7.0.70.0150.00615.22
7.0.60.0100.01115.17
7.0.50.0070.00915.34
7.0.40.0120.00315.21
7.0.30.0140.00215.20
7.0.20.0110.00915.30
7.0.10.0110.00715.28
7.0.00.0100.00915.33
5.6.400.0150.00614.36
5.6.390.0080.01214.28
5.6.380.0110.00714.13
5.6.370.0190.00314.61
5.6.360.0130.01014.31
5.6.350.0070.01514.01
5.6.340.0110.01114.29
5.6.330.0080.01214.34
5.6.320.0140.00614.28
5.6.310.0160.00614.46
5.6.300.0100.02017.57
5.6.290.0100.03317.61
5.6.280.0120.02417.72
5.6.270.0120.02317.58
5.6.260.0100.02517.64
5.6.250.0130.04017.79
5.6.240.0030.04217.55
5.6.230.0090.02517.57
5.6.220.0060.03217.58
5.6.210.0070.03517.74
5.6.200.0060.03017.77
5.6.190.0090.03117.64
5.6.180.0110.04317.48
5.6.170.0080.02317.47
5.6.160.0080.03917.61
5.6.150.0070.03017.65
5.6.140.0090.02617.49
5.6.130.0120.02517.69
5.6.120.0090.03017.45
5.6.110.0120.02317.49
5.6.100.0070.02717.71
5.6.90.0080.02317.62
5.6.80.0020.03517.38
5.6.70.0050.02717.25
5.6.60.0050.02617.35
5.6.50.0150.01717.22
5.6.40.0120.04117.33
5.6.30.0090.02717.12
5.6.20.0080.03417.25
5.6.10.0120.02017.16
5.6.00.0040.02817.12
5.5.380.0090.04115.88
5.5.370.0060.02415.71
5.5.360.0100.04415.90
5.5.350.0100.02715.90
5.5.340.0070.04716.10
5.5.330.0090.03216.14
5.5.320.0140.01715.92
5.5.310.0060.04615.99
5.5.300.0120.02316.07
5.5.290.0040.03516.16
5.5.280.0020.02916.13
5.5.270.0100.03716.15
5.5.260.0070.02516.28
5.5.250.0020.02916.15
5.5.240.0110.02015.59
5.5.230.0050.02715.79
5.5.220.0060.02515.85
5.5.210.0080.02315.88
5.5.200.0050.02615.80
5.5.190.0080.02515.70
5.5.180.0060.02515.81
5.5.170.0150.00314.24
5.5.160.0160.02315.79
5.5.150.0110.02015.87
5.5.140.0100.03015.81
5.5.130.0060.03015.75
5.5.120.0090.03115.92
5.5.110.0040.04515.83
5.5.100.0090.02715.68
5.5.90.0100.02715.86
5.5.80.0070.02315.66
5.5.70.0050.02715.88
5.5.60.0020.02815.72
5.5.50.0060.04415.71
5.5.40.0110.01915.78
5.5.30.0040.02615.60
5.5.20.0120.04315.55
5.5.10.0120.04415.75
5.5.00.0060.02415.82
5.4.450.0080.02815.10
5.4.440.0080.04315.18
5.4.430.0060.02215.16
5.4.420.0100.02115.20
5.4.410.0070.02115.22
5.4.400.0080.01914.94
5.4.390.0020.02514.86
5.4.380.0080.02015.01
5.4.370.0060.02115.01
5.4.360.0080.02414.94
5.4.350.0070.02014.96
5.4.340.0080.02015.16
5.4.330.0000.01010.74
5.4.320.0080.02715.01
5.4.310.0090.02114.97
5.4.300.0080.02215.01
5.4.290.0080.02115.05
5.4.280.0060.02214.99
5.4.270.0050.02214.99
5.4.260.0070.02215.02
5.4.250.0030.02515.17
5.4.240.0070.02415.04
5.4.230.0070.02615.08
5.4.220.0050.03714.95
5.4.210.0070.02314.91
5.4.200.0060.02314.93
5.4.190.0040.02315.01
5.4.180.0090.02514.94
5.4.170.0060.02115.07
5.4.160.0050.02415.13
5.4.150.0060.02314.95
5.4.140.0090.03713.99
5.4.130.0060.02213.96
5.4.120.0060.02414.05
5.4.110.0090.02113.96
5.4.100.0050.02313.97
5.4.90.0070.02013.94
5.4.80.0070.02213.98
5.4.70.0070.02613.96
5.4.60.0060.02113.98
5.4.50.0030.02513.96
5.4.40.0090.01914.02
5.4.30.0060.02013.92
5.4.20.0020.02413.97
5.4.10.0000.02614.00
5.4.00.0090.03913.99
5.3.290.0050.02713.65
5.3.280.0030.02413.52
5.3.270.0060.02513.46
5.3.260.0050.02213.64
5.3.250.0080.01713.63
5.3.240.0060.03913.43
5.3.230.0040.02713.58
5.3.220.0050.02013.56
5.3.210.0060.02213.46
5.3.200.0060.03213.55
5.3.190.0090.01913.62
5.3.180.0090.01913.55
5.3.170.0090.01713.69
5.3.160.0050.02113.64
5.3.150.0050.02113.64
5.3.140.0070.02113.67
5.3.130.0090.01913.65
5.3.120.0060.02113.63
5.3.110.0080.04013.58
5.3.100.0050.02213.67
5.3.90.0070.02213.61
5.3.80.0090.02713.49
5.3.70.0030.02513.46
5.3.60.0050.02113.62
5.3.50.0020.02113.53
5.3.40.0080.02213.48
5.3.30.0100.01413.57
5.3.20.0020.02413.53
5.3.10.0060.02313.47
5.3.00.0090.02213.49
5.2.170.0030.01813.16
5.2.160.0040.01613.16
5.2.150.0020.02013.16
5.2.140.0040.01713.16
5.2.130.0030.02013.16
5.2.120.0050.01713.16
5.2.110.0050.01513.16
5.2.100.0050.01513.16
5.2.90.0060.01413.16
5.2.80.0040.03113.16
5.2.70.0050.01813.16
5.2.60.0050.01713.16
5.2.50.0070.01413.16
5.2.40.0030.01813.16
5.2.30.0040.01713.16
5.2.20.0040.01713.16
5.2.10.0040.01913.16
5.2.00.0040.02113.16
5.1.60.0070.01313.16
5.1.50.0040.02513.16
5.1.40.0050.01213.16
5.1.30.0060.01613.16
5.1.20.0030.01613.16
5.1.10.0090.01213.16
5.1.00.0060.01513.16
5.0.50.0040.01113.16
5.0.40.0040.01213.16
5.0.30.0020.01813.16
5.0.20.0060.01513.16
5.0.10.0080.00713.16
5.0.00.0050.01613.16
4.4.90.0030.00813.16
4.4.80.0020.01313.16
4.4.70.0060.00713.16
4.4.60.0060.00713.16
4.4.50.0060.00713.16
4.4.40.0060.01413.16
4.4.30.0020.01113.16
4.4.20.0040.00813.16
4.4.10.0020.01113.16
4.4.00.0030.01413.16
4.3.110.0020.01013.16
4.3.100.0020.00913.16
4.3.90.0010.01013.16
4.3.80.0020.01513.16
4.3.70.0040.01413.16
4.3.60.0000.01813.16
4.3.50.0060.00813.16
4.3.40.0040.01313.16
4.3.30.0000.01413.16
4.3.20.0020.02013.16
4.3.10.0030.00813.16
4.3.00.0060.01113.16

preferences:
76.78 ms | 403 KiB | 5 Q