3v4l.org

run code in 300+ PHP versions simultaneously
<?php class values implements \Iterator{ private $_data = null; // array or object private $_keys = array(); private $_key = false; public function __construct($data = null){ if (null !== $data){ $this->_data = $data; } } // ------------ \Iterator implementation public function current(){ return $this->{$this->_key}; } public function key(){ return $this->_key; } public function next(){ $this->_key = \next($this->_keys); } public function rewind(){ $this->_keys = []; foreach ($this->_data as $k => $v){ $this->_keys[] = $k; } $this->_key = \reset($this->_keys); } public function valid(){ if (false === $this->_key){ return false; } return isset($this->{$this->_key}); } } $values = new values(new DateTime()); foreach($values as $k => $v) { var_dump($k, $v); }

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.0170.00017.13
8.3.50.0160.00518.54
8.3.40.0100.00718.96
8.3.30.0090.00619.10
8.3.20.0080.00018.86
8.3.10.0080.00018.85
8.3.00.0080.00019.50
8.2.180.0140.00716.88
8.2.170.0100.00622.96
8.2.160.0090.00618.95
8.2.150.0080.00024.18
8.2.140.0080.00024.66
8.2.130.0000.00826.16
8.2.120.0000.00819.54
8.2.110.0070.00419.35
8.2.100.0080.00417.97
8.2.90.0040.00417.88
8.2.80.0050.00317.97
8.2.70.0000.00817.93
8.2.60.0040.00418.22
8.2.50.0030.00618.10
8.2.40.0090.00020.59
8.2.30.0040.00419.33
8.2.20.0040.00717.88
8.2.10.0030.00519.53
8.2.00.0030.00617.82
8.1.280.0120.00925.92
8.1.270.0080.00023.99
8.1.260.0040.00426.35
8.1.250.0080.00028.09
8.1.240.0090.00022.74
8.1.230.0000.01119.09
8.1.220.0040.00417.79
8.1.210.0030.00718.77
8.1.200.0000.00917.47
8.1.190.0030.00617.48
8.1.180.0040.00418.10
8.1.170.0030.00618.78
8.1.160.0000.00718.96
8.1.150.0040.00418.96
8.1.140.0040.00417.74
8.1.130.0030.00619.46
8.1.120.0020.00517.57
8.1.110.0000.00717.65
8.1.100.0040.00417.66
8.1.90.0000.00817.68
8.1.80.0030.00517.56
8.1.70.0030.00317.68
8.1.60.0030.00517.72
8.1.50.0040.00417.53
8.1.40.0000.00817.66
8.1.30.0000.00817.70
8.1.20.0000.00917.89
8.1.10.0000.00817.67
8.1.00.0000.00917.66
8.0.300.0030.00618.77
8.0.290.0070.00316.75
8.0.280.0030.00318.58
8.0.270.0030.00317.25
8.0.260.0070.00017.16
8.0.250.0040.00817.08
8.0.240.0040.00417.16
8.0.230.0000.00817.19
8.0.220.0110.00017.13
8.0.210.0000.00717.15
8.0.200.0000.00817.23
8.0.190.0080.00017.18
8.0.180.0040.00417.14
8.0.170.0030.00517.05
8.0.160.0000.00917.21
8.0.150.0040.00417.02
8.0.140.0070.00017.13
8.0.130.0000.00613.46
8.0.120.0040.00417.01
8.0.110.0000.00717.07
8.0.100.0040.00417.04
8.0.90.0040.00417.15
8.0.80.0080.00817.14
8.0.70.0040.00416.98
8.0.60.0000.00917.12
8.0.50.0000.00816.97
8.0.30.0150.00717.05
8.0.20.0230.00917.24
8.0.10.0040.00417.08
8.0.00.0130.00416.73
7.4.330.0050.00013.16
7.4.320.0030.00316.68
7.4.300.0030.00316.74
7.4.290.0030.00616.81
7.4.280.0000.00916.68
7.4.270.0050.00316.60
7.4.260.0000.00513.43
7.4.250.0030.00516.75
7.4.240.0030.00316.72
7.4.230.0070.00016.67
7.4.220.0030.01716.72
7.4.210.0090.01316.77
7.4.200.0030.00316.80
7.4.190.0040.00416.87
7.4.160.0090.00616.72
7.4.150.0090.00916.76
7.4.140.0030.01817.86
7.4.130.0060.01616.78
7.4.120.0100.01016.80
7.4.110.0110.01116.63
7.4.100.0000.01616.73
7.4.90.0090.01216.66
7.4.80.0040.01819.39
7.4.70.0110.01416.88
7.4.60.0080.00816.66
7.4.50.0030.00316.48
7.4.40.0090.00616.41
7.4.30.0130.01016.70
7.4.00.0070.01015.03
7.3.330.0070.00013.51
7.3.320.0050.00013.36
7.3.310.0000.00716.38
7.3.300.0060.00016.47
7.3.290.0070.00816.51
7.3.280.0040.01116.58
7.3.270.0190.00616.66
7.3.260.0060.01516.61
7.3.240.0030.01316.61
7.3.230.0100.01016.74
7.3.210.0060.01616.70
7.3.200.0080.00816.67
7.3.190.0060.01416.58
7.3.180.0130.00616.59
7.3.170.0100.00716.61
7.3.160.0030.01316.82
7.3.120.0000.01114.97
7.2.330.0150.00317.00
7.2.320.0100.01016.60
7.2.310.0130.00917.04
7.2.300.0030.01716.95
7.2.290.0140.00416.71
7.2.120.0130.00616.88
7.2.110.0260.00716.63
7.2.100.0150.00615.83
7.2.90.0460.00815.89
7.2.80.0240.00616.05
7.2.70.0210.00616.29
7.2.60.0510.00516.22
7.2.50.0560.00516.03
7.2.40.0250.01316.22
7.2.30.0290.00616.18
7.2.20.0150.00716.03
7.2.10.0290.00415.92
7.2.00.0220.00515.99
7.1.240.0110.00615.89
7.1.230.0290.01015.73
7.1.220.0450.00314.78
7.1.210.0410.00414.76
7.1.200.0430.00814.97
7.1.190.0330.00615.03
7.1.180.0130.00914.97
7.1.170.0130.01015.04
7.1.160.0370.00714.87
7.1.150.0110.00914.90
7.1.140.0590.00414.82
7.1.130.0210.00414.98
7.1.120.0660.00914.73
7.1.110.0150.01114.98
7.1.100.0230.00315.04
7.1.90.0240.00515.08
7.1.80.0170.00915.04
7.1.70.0470.00714.88
7.1.60.0570.00423.96
7.1.50.1020.00824.04
7.1.40.0660.00823.92
7.1.30.0750.00923.95
7.1.20.0640.01323.82
7.1.10.0270.00614.83
7.1.00.0380.00214.93
7.0.320.0090.00815.33
7.0.310.0230.00614.81
7.0.300.0510.00514.51
7.0.290.0300.00714.40
7.0.280.0170.00614.45
7.0.270.0240.00714.39
7.0.260.0570.00414.64
7.0.250.0270.00514.63
7.0.240.0510.00514.51
7.0.230.0400.00114.75
7.0.220.0190.01214.44
7.0.210.0530.00514.64
7.0.200.0600.00514.62
7.0.190.0700.01114.44
7.0.180.0590.00314.46
7.0.170.0600.00514.47
7.0.160.0520.00814.61
7.0.150.0680.00614.57
7.0.140.0440.00514.47
7.0.130.0770.00414.56
7.0.120.0270.00714.42
7.0.110.0300.00614.45
7.0.100.0630.00814.40
7.0.90.0640.01014.41
7.0.80.0590.00714.27
7.0.70.0220.00414.27
7.0.60.0560.00814.60
7.0.50.0580.00614.66
7.0.40.0640.00613.75
7.0.30.0610.00313.48
7.0.20.0620.00913.58
7.0.10.0570.00513.74
7.0.00.0250.01013.46
5.6.380.0100.00814.40
5.6.370.0120.00214.49
5.6.360.0100.00414.45
5.6.350.0100.00714.55
5.6.340.0090.00314.36
5.6.330.0080.01014.53
5.6.320.0120.00414.61
5.6.310.0090.00714.60
5.6.300.0080.01214.42
5.6.290.0050.01014.47
5.6.280.0080.00714.49
5.6.270.0060.01014.66
5.6.260.0140.00614.59
5.6.250.0090.00714.40
5.6.240.0090.00514.46
5.6.230.0100.00514.32
5.6.220.0140.00914.49
5.6.210.0110.00714.55
5.6.200.0140.00414.59
5.6.190.0170.00514.48
5.6.180.0100.00714.60
5.6.170.0130.00714.63
5.6.160.0120.00514.57
5.6.150.0080.00914.60
5.6.140.0060.01114.45
5.6.130.0150.00314.48
5.6.120.0140.00514.36
5.6.110.0160.00414.20
5.6.100.0140.00914.26
5.6.90.0110.00814.38
5.6.80.0120.00614.19
5.6.70.0080.01014.50
5.6.60.0110.00614.65
5.6.50.0130.00314.36
5.6.40.0110.00714.40
5.6.30.0110.00614.48
5.6.20.0100.00714.33
5.6.10.0100.00614.51
5.6.00.0070.01114.39
5.5.380.0080.00511.30
5.5.370.0110.00311.52
5.5.360.0040.00811.46
5.5.350.0080.00611.43
5.5.340.0090.00411.56
5.5.330.0070.00511.36
5.5.320.0050.00811.38
5.5.310.0090.00611.32
5.5.300.0120.00211.31
5.5.290.0070.00511.24
5.5.280.0090.00311.28
5.5.270.0110.00311.26
5.5.260.0050.00711.12
5.5.250.0110.00111.04
5.5.240.0060.00511.44
5.5.230.0060.00611.14
5.5.220.0090.00311.37
5.5.210.0040.00711.41
5.5.200.0050.00811.28
5.5.190.0090.00411.19
5.5.180.0060.00611.17
5.5.170.0140.00414.24
5.5.160.0090.00111.08
5.5.150.0090.00511.40
5.5.140.0060.00411.25
5.5.130.0070.00511.26
5.5.120.0040.00610.95
5.5.110.0040.00511.19
5.5.100.0060.00511.24
5.5.90.0070.00411.28
5.5.80.0050.00811.37
5.5.70.0090.00311.28
5.5.60.0070.00811.26
5.5.50.0070.00411.32
5.5.40.0070.00411.04
5.5.30.0070.00611.28
5.5.20.0030.00711.21
5.5.10.0100.00411.07
5.5.00.0120.00311.22
5.4.450.0070.00411.27
5.4.440.0060.00511.39
5.4.430.0080.00311.34
5.4.420.0080.00511.37
5.4.410.0070.00511.33
5.4.400.0030.00811.12
5.4.390.0070.00711.31
5.4.380.0080.00411.22
5.4.370.0060.00611.15
5.4.360.0090.00411.15
5.4.350.0050.00711.22
5.4.340.0080.00311.19
5.4.330.0060.00711.16
5.4.320.0030.00911.15
5.4.310.0070.00511.20
5.4.300.0110.00310.95
5.4.290.0090.00311.30
5.4.280.0080.00411.02
5.4.270.0060.00611.30
5.4.260.0050.00511.30
5.4.250.0050.00511.25
5.4.240.0070.00411.20
5.4.230.0030.00911.09
5.4.220.0060.00611.35
5.4.210.0090.00411.22
5.4.200.0040.00611.02
5.4.190.0060.00611.04
5.4.180.0070.00511.14
5.4.170.0070.00511.12
5.4.160.0060.00510.98
5.4.150.0110.00611.07
5.4.140.0050.00811.19
5.4.130.0080.00510.95
5.4.120.0100.00611.07
5.4.110.0100.00211.31
5.4.100.0070.00411.18
5.4.90.0110.00411.18
5.4.80.0120.00411.21
5.4.70.0080.00511.17
5.4.60.0090.00611.02
5.4.50.0110.00411.03
5.4.40.0070.00410.99
5.4.30.0070.00611.17
5.4.20.0110.00310.89
5.4.10.0050.00511.24
5.4.00.0080.00311.37
5.3.290.0070.00310.62
5.3.280.0050.00710.61
5.3.270.0060.00610.59
5.3.260.0040.00610.70
5.3.250.0080.00210.72
5.3.240.0080.00510.52
5.3.230.0060.00410.65
5.3.220.0100.00110.65
5.3.210.0040.00710.69
5.3.200.0090.00210.70
5.3.190.0070.00510.70
5.3.180.0080.00310.79
5.3.170.0090.00310.70
5.3.160.0060.00410.65
5.3.150.0110.00010.74
5.3.140.0100.00110.75
5.3.130.0060.00410.51
5.3.120.0020.00810.64
5.3.110.0060.00410.58
5.3.100.0020.00710.59
5.3.90.0050.00610.58
5.3.80.0010.00810.49
5.3.70.0080.00310.61
5.3.60.0090.00110.59
5.3.50.0050.00510.54
5.3.40.0070.00210.53
5.3.30.0070.00510.52
5.3.20.0020.00910.52
5.3.10.0040.00610.41
5.3.00.0080.00210.40
5.2.170.0050.0029.89
5.2.160.0060.0039.98
5.2.150.0060.0029.97
5.2.140.0030.0069.96
5.2.130.0040.0039.98
5.2.120.0050.0049.89
5.2.110.0080.0029.95
5.2.100.0050.0049.98
5.2.90.0060.0059.96
5.2.80.0070.0029.88
5.2.70.0030.0049.90
5.2.60.0070.0029.83
5.2.50.0090.0039.94
5.2.40.0050.0059.87
5.2.30.0020.0079.86
5.2.20.0040.0059.80
5.2.10.0080.0019.81
5.2.00.0070.0029.79
5.1.60.0080.0009.79
5.1.50.0020.0059.79
5.1.40.0050.0039.79
5.1.30.0010.0069.79
5.1.20.0050.0029.79
5.1.10.0030.0039.79
5.1.00.0050.0029.79
5.0.50.0030.0039.79
5.0.40.0040.0039.79
5.0.30.0020.0059.79
5.0.20.0030.0039.79
5.0.10.0030.0049.79
5.0.00.0030.0039.79
4.4.90.0020.0039.79
4.4.80.0020.0039.79
4.4.70.0010.0049.79
4.4.60.0010.0039.79
4.4.50.0040.0039.79
4.4.40.0010.0059.79
4.4.30.0040.0029.79
4.4.20.0010.0059.79
4.4.10.0040.0029.79
4.4.00.0030.0039.79
4.3.110.0020.0029.79
4.3.100.0040.0019.79
4.3.90.0020.0039.79
4.3.80.0020.0039.79
4.3.70.0020.0049.79
4.3.60.0040.0029.79
4.3.50.0020.0039.79
4.3.40.0020.0049.79
4.3.30.0000.0069.79
4.3.20.0030.0029.79
4.3.10.0020.0029.79
4.3.00.0010.0039.79

preferences:
55.66 ms | 401 KiB | 5 Q