3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Maps implements Iterator { protected $key, $data; public function __construct() { $key = new stdClass; $value = new stdClass; $key->long = 1.1; $key->lat = 42.0; $value = "New York, NY"; $this->data[] = array($key, $value); $key->long = 2.2; $key->lat = 24.0; $value = "Rochester, NY"; $this->data[] = array($key, $value); } public function key() { return $this->data[0]; } public function current() { return current($this->data[1]); } public function next() { return next($this->data[1]); } public function valid() { return key($this->data) !== null; } public function rewind() { reset($this->data); } } $maps = new Maps; foreach($maps as $keyMap => $locationMap) { var_dump($keyMap, $locationMap); }

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.0530.00418.30
8.3.50.0360.02921.17
8.3.40.0390.01118.67
8.3.30.0230.00319.25
8.3.20.0260.00320.33
8.3.10.0180.01821.86
8.3.00.0260.00419.63
8.2.180.0410.00716.38
8.2.170.0340.02722.96
8.2.160.0370.00320.39
8.2.150.0110.00424.18
8.2.140.0200.01024.66
8.2.130.0260.00026.16
8.2.120.0180.00919.34
8.2.110.0210.00720.38
8.2.100.0260.00618.03
8.2.90.0040.01119.30
8.2.80.0080.01217.97
8.2.70.0090.00617.63
8.2.60.0050.01418.03
8.2.50.0110.00718.07
8.2.40.0120.00619.94
8.2.30.0000.01218.14
8.2.20.0060.00617.83
8.2.10.0090.00618.20
8.2.00.0130.00717.70
8.1.280.0440.00025.92
8.1.270.0190.01023.99
8.1.260.0310.00726.35
8.1.250.0250.00528.09
8.1.240.0190.00623.84
8.1.230.0210.00919.09
8.1.220.0080.00317.74
8.1.210.0070.01118.77
8.1.200.0100.00717.23
8.1.190.0100.00317.24
8.1.180.0110.00718.10
8.1.170.0130.00618.50
8.1.160.0090.00922.10
8.1.150.0110.00019.02
8.1.140.0070.00417.43
8.1.130.0110.00717.95
8.1.120.0000.01017.51
8.1.110.0120.00617.55
8.1.100.0040.00717.52
8.1.90.0000.01617.55
8.1.80.0070.01117.46
8.1.70.0180.00017.50
8.1.60.0130.00617.69
8.1.50.0040.01517.57
8.1.40.0040.00717.53
8.1.30.0110.00317.73
8.1.20.0100.00017.59
8.1.10.0100.01017.62
8.1.00.0110.00417.44
8.0.300.0070.00318.77
8.0.290.0040.00816.63
8.0.280.0040.00818.45
8.0.270.0030.00717.10
8.0.260.0070.00317.20
8.0.250.0000.01116.93
8.0.240.0000.00916.79
8.0.230.0100.00016.87
8.0.220.0090.00716.68
8.0.210.0180.00016.79
8.0.200.0040.01116.79
8.0.190.0070.00316.85
8.0.180.0100.00016.84
8.0.170.0080.00416.86
8.0.160.0070.00416.79
8.0.150.0100.00016.78
8.0.140.0130.00316.86
8.0.130.0030.00613.37
8.0.120.0090.00616.82
8.0.110.0030.00716.84
8.0.100.0030.01016.71
8.0.90.0100.00316.76
8.0.80.0150.03116.82
8.0.70.0050.00816.62
8.0.60.0040.01316.81
8.0.50.0030.00716.66
8.0.30.0480.03816.91
8.0.20.0710.03717.40
8.0.10.0040.00716.79
8.0.00.0390.03516.78
7.4.330.0060.00315.00
7.4.320.0040.00816.49
7.4.300.0050.00516.39
7.4.290.0130.01316.48
7.4.280.0030.01316.38
7.4.270.0100.00716.54
7.4.260.0090.00916.36
7.4.250.0040.01116.39
7.4.240.0110.00516.45
7.4.230.0080.00516.29
7.4.220.0340.05716.35
7.4.210.0250.03816.52
7.4.200.0100.00016.18
7.4.160.0380.02416.55
7.4.150.0530.03217.40
7.4.140.0670.03317.86
7.4.130.0450.03316.30
7.4.120.0560.02816.53
7.4.110.0330.05816.50
7.4.100.0680.02816.43
7.4.90.0440.01516.34
7.4.80.0630.03519.39
7.4.70.0440.03716.56
7.4.60.0340.05116.42
7.4.50.0180.00416.31
7.4.40.0290.02516.50
7.4.30.0450.01616.55
7.4.00.0380.00915.03
7.3.330.0110.00713.31
7.3.320.0060.00613.36
7.3.310.0060.00616.13
7.3.300.0130.00916.09
7.3.290.0140.03216.24
7.3.280.0310.03916.25
7.3.270.0470.04017.40
7.3.260.0340.01216.19
7.3.250.0530.02716.38
7.3.240.0310.03716.30
7.3.230.0450.03416.39
7.3.210.0430.05616.14
7.3.200.0780.06719.39
7.3.190.0760.03716.49
7.3.180.0480.02716.33
7.3.170.0330.03016.27
7.3.160.0400.02216.33
7.2.330.0510.03116.52
7.2.320.0320.04316.43
7.2.310.0420.03216.43
7.2.300.0320.03616.67
7.2.290.0450.03516.79
7.2.80.0130.01316.53
7.2.60.0250.00916.96
7.2.00.0100.01019.39
7.1.200.0100.02415.57
7.1.100.0080.01118.19
7.1.70.0160.00317.07
7.1.60.0270.01319.32
7.1.50.0310.01416.97
7.0.200.0080.01116.51

preferences:
86.94 ms | 401 KiB | 5 Q