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){ $this->_data = $data; } public function current(){ return $this->_data->{"{$this->_key}"}; } public function key(){ return $this->_key; } public function next(){ $this->_key = next($this->_keys); } public function rewind(){ $this->_keys = array(); 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->_data->{"{$this->_key}"}); } } $values = new values(new DateTime()); for ($i = 0; $i < 100; $i++){ 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.0150.00618.64
8.3.50.0260.00421.21
8.3.40.0110.01118.93
8.3.30.0030.01020.31
8.3.20.0080.00020.38
8.3.10.0000.00821.04
8.3.00.0040.00422.52
8.2.180.0170.00316.63
8.2.170.0160.00322.96
8.2.160.0130.00721.93
8.2.150.0120.00324.18
8.2.140.0040.00424.66
8.2.130.0060.00326.16
8.2.120.0040.00420.66
8.2.110.0040.00419.39
8.2.100.0120.00018.03
8.2.90.0000.00819.30
8.2.80.0000.00817.97
8.2.70.0060.00317.75
8.2.60.0030.00618.01
8.2.50.0080.00018.07
8.2.40.0090.00018.34
8.2.30.0000.00719.53
8.2.20.0000.00717.74
8.2.10.0030.00517.96
8.2.00.0000.00917.84
8.1.280.0150.00025.92
8.1.270.0080.00023.99
8.1.260.0040.00426.35
8.1.250.0070.00028.09
8.1.240.0060.00322.44
8.1.230.0110.00021.04
8.1.220.0080.00018.77
8.1.210.0090.00019.03
8.1.200.0050.00517.60
8.1.190.0000.00917.64
8.1.180.0000.00818.10
8.1.170.0070.00418.52
8.1.160.0040.00719.02
8.1.150.0050.00218.85
8.1.140.0000.00817.67
8.1.130.0030.00617.91
8.1.120.0080.00017.59
8.1.110.0030.00517.66
8.1.100.0060.00317.70
8.1.90.0040.00417.66
8.1.80.0000.00817.58
8.1.70.0030.00317.56
8.1.60.0060.00317.75
8.1.50.0000.00817.69
8.1.40.0000.00717.59
8.1.30.0030.00617.72
8.1.20.0040.00417.82
8.1.10.0030.00617.59
8.1.00.0000.00817.63
8.0.300.0030.00320.16
8.0.290.0040.00417.29
8.0.280.0070.00018.54
8.0.270.0000.00717.27
8.0.260.0000.00717.04
8.0.250.0000.00717.21
8.0.240.0040.00417.10
8.0.230.0040.00417.18
8.0.220.0000.00717.04
8.0.210.0000.00717.11
8.0.200.0000.00717.16
8.0.190.0030.00317.23
8.0.180.0070.00017.14
8.0.170.0090.00017.16
8.0.160.0000.00717.08
8.0.150.0040.00416.96
8.0.140.0000.00717.11
8.0.130.0000.00513.52
8.0.120.0030.00517.07
8.0.110.0040.00417.11
8.0.100.0070.00017.05
8.0.90.0000.00816.98
8.0.80.0130.00617.11
8.0.70.0080.00017.02
8.0.60.0000.00817.14
8.0.50.0000.00817.18
8.0.30.0100.00817.32
8.0.20.0120.00717.40
8.0.10.0050.00217.10
8.0.00.0130.00616.83
7.4.330.0000.00516.73
7.4.320.0000.00616.77
7.4.300.0000.00716.62
7.4.290.0000.00716.66
7.4.280.0040.00416.56
7.4.270.0030.00316.66
7.4.260.0000.00513.35
7.4.250.0040.00416.59
7.4.240.0030.00316.65
7.4.230.0030.00316.51
7.4.220.0180.00716.80
7.4.210.0090.00916.67
7.4.200.0030.00316.88
7.4.190.0070.00016.65
7.4.160.0090.00616.75
7.4.150.0130.03617.40
7.4.140.0080.01017.86
7.4.130.0090.00816.79
7.4.120.0090.00816.67
7.4.110.0120.00616.64
7.4.100.0100.00716.70
7.4.90.0060.01116.80
7.4.80.0140.00719.39
7.4.70.0090.01216.83
7.4.60.0100.00616.70
7.4.50.0030.00616.85
7.4.40.0080.00822.77
7.4.30.0170.00316.72
7.3.330.0030.00313.38
7.3.320.0000.00613.31
7.3.310.0030.00616.49
7.3.300.0030.00516.46
7.3.290.0120.00616.45
7.3.280.0120.00916.44
7.3.270.0120.01217.40
7.3.260.0110.02118.24
7.3.250.0130.01316.72
7.3.240.0290.00016.62
7.3.230.0060.01916.70
7.3.210.0140.02016.54
7.3.200.0190.01119.39
7.3.190.0140.00916.55
7.3.180.0100.01316.73
7.3.170.0140.00716.57
7.3.160.0190.01216.66
7.2.330.0190.00517.01
7.2.320.0170.00716.60
7.2.310.0170.01016.82
7.2.300.0130.01016.59
7.2.290.0100.01416.95
5.4.450.0070.05019.46
5.4.440.0000.05719.49
5.4.430.0030.07719.55
5.4.420.0070.04719.30
5.4.410.0100.07319.17
5.4.400.0030.05319.20
5.4.390.0100.07019.13
5.4.380.0030.07718.87
5.4.370.0070.07318.85
5.4.360.0030.05319.14
5.4.350.0030.07719.09
5.4.340.0030.05019.09
5.4.320.0070.07319.22
5.4.310.0030.07018.99
5.4.300.0070.05718.84
5.4.290.0030.06319.21
5.4.280.0030.08018.98
5.4.270.0030.06719.08
5.4.260.0030.06319.23
5.4.250.0000.07019.00
5.4.240.0100.07719.30
5.4.230.0070.07719.18
5.4.220.0030.08019.30
5.4.210.0070.04019.18
5.4.200.0100.03718.98
5.4.190.0030.04319.21
5.4.180.0070.03319.20
5.4.170.0000.04719.13
5.4.160.0000.03719.15
5.4.150.0000.04019.20
5.4.140.0000.03716.72
5.4.130.0000.04016.32
5.4.120.0030.03316.50
5.4.110.0000.03716.30
5.4.100.0000.03716.50
5.4.90.0030.03716.45
5.4.80.0000.04316.59
5.4.70.0030.03316.49
5.4.60.0000.03716.53
5.4.50.0030.03316.50
5.4.40.0030.03316.52
5.4.30.0030.03316.48
5.4.20.0000.03716.55
5.4.10.0000.03716.23
5.4.00.0070.03015.80
5.3.290.0100.04714.67
5.3.280.0070.07714.62
5.3.270.0030.03714.59
5.3.260.0000.04314.62
5.3.250.0070.03314.66
5.3.240.0030.04014.61
5.3.230.0130.03314.72
5.3.220.0130.03314.50
5.3.210.0030.04014.69
5.3.200.0030.03714.49
5.3.190.0000.04314.44
5.3.180.0000.04014.49
5.3.170.0070.03314.50
5.3.160.0030.03714.64
5.3.150.0030.03314.58
5.3.140.0000.03714.55
5.3.130.0070.03714.56
5.3.120.0030.03714.48
5.3.110.0030.03714.77
5.3.100.0000.03714.05
5.3.90.0000.03714.02
5.3.80.0030.04313.95
5.3.70.0030.03714.05
5.3.60.0000.03714.10
5.3.50.0000.03713.94
5.3.40.0000.04014.12
5.3.30.0000.03713.86
5.3.20.0030.04013.86
5.3.10.0000.07313.86
5.3.00.0070.07313.87

preferences:
48.82 ms | 401 KiB | 5 Q