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 $this->data[1]; } public function next() { next($this->data); } 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.0090.00918.55
8.3.50.0140.00621.19
8.3.40.0070.00719.14
8.3.30.0140.00319.27
8.3.20.0000.00820.31
8.3.10.0090.00923.66
8.3.00.0080.00417.24
8.2.180.0110.00418.54
8.2.170.0070.00722.96
8.2.160.0070.00720.47
8.2.150.0060.00324.18
8.2.140.0040.00424.66
8.2.130.0080.00026.16
8.2.120.0040.00422.26
8.2.110.0060.00320.57
8.2.100.0030.00918.03
8.2.90.0080.00019.05
8.2.80.0000.00817.97
8.2.70.0050.00517.61
8.2.60.0040.00418.05
8.2.50.0040.00418.07
8.2.40.0000.00820.04
8.2.30.0040.00418.11
8.2.20.0040.00417.66
8.2.10.0000.00718.00
8.2.00.0030.00517.65
8.1.280.0120.00325.92
8.1.270.0060.00323.96
8.1.260.0070.00026.35
8.1.250.0040.00428.09
8.1.240.0090.00023.87
8.1.230.0110.00018.97
8.1.220.0080.00017.74
8.1.210.0060.00318.77
8.1.200.0100.00017.23
8.1.190.0060.00317.35
8.1.180.0000.00818.10
8.1.170.0050.00318.50
8.1.160.0060.00321.99
8.1.150.0000.00718.80
8.1.140.0070.00017.41
8.1.130.0040.00417.83
8.1.120.0040.00417.43
8.1.110.0050.00317.38
8.1.100.0040.00417.41
8.1.90.0000.00717.42
8.1.80.0020.00517.51
8.1.70.0080.00017.30
8.1.60.0040.00417.59
8.1.50.0090.00017.54
8.1.40.0030.00617.53
8.1.30.0000.00817.66
8.1.20.0030.00617.61
8.1.10.0040.00417.59
8.1.00.0040.00417.56
8.0.300.0070.00018.77
8.0.290.0050.00316.75
8.0.280.0000.00818.46
8.0.270.0000.00717.13
8.0.260.0030.00317.25
8.0.250.0000.00716.88
8.0.240.0060.00016.96
8.0.230.0040.00416.91
8.0.220.0030.00616.82
8.0.210.0050.00216.90
8.0.200.0060.00016.91
8.0.190.0030.00616.82
8.0.180.0070.00016.91
8.0.170.0000.00816.92
8.0.160.0070.00016.89
8.0.150.0000.00716.96
8.0.140.0000.00716.86
8.0.130.0030.00313.36
8.0.120.0080.00016.77
8.0.110.0040.00416.81
8.0.100.0070.00016.78
8.0.90.0070.00016.96
8.0.80.0100.01316.81
8.0.70.0000.00816.84
8.0.60.0000.00816.96
8.0.50.0040.00416.78
8.0.30.0100.01217.08
8.0.20.0170.00517.44
8.0.10.0040.00417.05
8.0.00.0070.01016.87
7.4.330.0020.00215.00
7.4.320.0030.00316.41
7.4.300.0000.00716.40
7.4.290.0060.00316.52
7.4.280.0050.00316.39
7.4.270.0030.00316.63
7.4.260.0000.00716.54
7.4.250.0050.00216.61
7.4.240.0030.00416.57
7.4.230.0040.00416.68
7.4.220.0100.00716.64
7.4.210.0070.00716.53
7.4.200.0000.00716.42
7.4.160.0070.00916.62
7.4.150.0160.00317.40
7.4.140.0090.01417.86
7.4.130.0090.00916.47
7.4.120.0050.01316.59
7.4.110.0090.00916.47
7.4.100.0060.01616.38
7.4.90.0090.00916.49
7.4.80.0100.01019.39
7.4.70.0120.00616.44
7.4.60.0090.00916.48
7.4.50.0040.00416.55
7.4.40.0160.00316.46
7.4.30.0100.00716.23
7.4.10.0090.00814.90
7.4.00.0090.00615.10
7.3.330.0030.00313.35
7.3.320.0000.00513.31
7.3.310.0000.00716.36
7.3.300.0040.00416.41
7.3.290.0030.01016.36
7.3.280.0050.01316.35
7.3.270.0090.00917.40
7.3.260.0070.01016.35
7.3.240.0140.00516.49
7.3.230.0160.00316.60
7.3.210.0040.01216.55
7.3.200.0070.01419.39
7.3.190.0210.00016.38
7.3.180.0030.01416.41
7.3.170.0030.01416.47
7.3.160.0130.01016.38
7.3.130.0030.01315.04
7.3.120.0050.01114.95
7.3.110.0070.01014.89
7.3.100.0050.01015.03
7.3.90.0070.01015.13
7.3.80.0050.00914.96
7.3.70.0040.00914.99
7.3.60.0080.00614.93
7.3.50.0050.00914.89
7.3.40.0030.01115.00
7.3.30.0120.00414.96
7.3.20.0050.01116.55
7.3.10.0070.00716.50
7.3.00.0070.00816.64
7.2.330.0140.00416.86
7.2.320.0050.01416.51
7.2.310.0030.02116.48
7.2.300.0100.00616.57
7.2.290.0160.00316.55
7.2.260.0050.01415.02
7.2.250.0050.01215.19
7.2.240.0050.00915.00
7.2.230.0080.00815.15
7.2.220.0030.01515.14
7.2.210.0030.00714.89
7.2.200.0110.00415.09
7.2.190.0050.01015.12
7.2.180.0020.00815.06
7.2.170.0020.01114.98
7.2.160.0070.00915.15
7.2.150.0050.01216.86
7.2.140.0070.00716.94
7.2.130.0080.01016.89
7.2.120.0030.01216.95
7.2.110.0020.01116.96
7.2.100.0090.00716.97
7.2.90.0050.00716.96
7.2.80.0050.01116.95
7.2.70.0090.00417.01
7.2.60.0080.00816.96
7.2.50.0060.01116.95
7.2.40.0040.01216.89
7.2.30.0080.00617.00
7.2.20.0000.01416.77
7.2.10.0090.00316.78
7.2.00.0070.00817.71
7.1.330.0080.00615.73
7.1.320.0050.01115.82
7.1.310.0030.00915.83
7.1.300.0030.01215.71
7.1.290.0060.00615.70
7.1.280.0020.01215.73
7.1.270.0050.01115.84
7.1.260.0030.00915.87
7.1.250.0040.01315.83
7.1.240.0090.00415.69
7.1.230.0050.00415.80
7.1.220.0070.00815.88
7.1.210.0040.01115.90
7.1.200.0050.01115.85
7.1.190.0060.00815.73
7.1.180.0070.00915.89
7.1.170.0060.00615.70
7.1.160.0060.00915.66
7.1.150.0080.00815.74
7.1.140.0050.00715.71
7.1.130.0020.00915.75
7.1.120.0050.01115.86
7.1.110.0090.00515.66
7.1.100.0030.00916.71
7.1.90.0090.00215.88
7.1.80.0090.00715.76
7.1.70.0040.01016.31
7.1.60.0100.00917.03
7.1.50.0080.00916.23
7.1.40.0050.01015.86
7.1.30.0050.00815.76
7.1.20.0020.01115.88
7.1.10.0090.00315.78
7.1.00.0080.02718.04
7.0.330.0020.01315.24
7.0.320.0050.00715.33
7.0.310.0080.00615.43
7.0.300.0040.01115.47
7.0.290.0080.00615.44
7.0.280.0050.00815.54
7.0.270.0080.00715.48
7.0.260.0030.01015.19
7.0.250.0050.00915.49
7.0.240.0060.00915.44
7.0.230.0050.00815.49
7.0.220.0110.00115.48
7.0.210.0050.00815.60
7.0.200.0050.00815.87
7.0.190.0070.00715.51
7.0.180.0090.00415.50
7.0.170.0080.00715.17
7.0.160.0070.00715.37
7.0.150.0050.01015.34
7.0.140.0060.02717.71
7.0.130.0050.00815.38
7.0.120.0050.00615.45
7.0.110.0060.00715.31
7.0.100.0010.00915.42
7.0.90.0050.00715.38
7.0.80.0120.00315.49
7.0.70.0110.00315.35
7.0.60.0060.02016.90
7.0.50.0070.03216.37
7.0.40.0100.03216.26
7.0.30.0180.01816.27
7.0.20.0110.03216.16
7.0.10.0110.02916.27
7.0.00.0090.01816.31
5.6.400.0050.00914.71
5.6.390.0050.00914.74
5.6.380.0030.00914.82
5.6.370.0030.01114.81
5.6.360.0020.01414.89
5.6.350.0080.01014.74
5.6.340.0060.00814.89
5.6.330.0070.00914.90
5.6.320.0050.01014.71
5.6.310.0040.00714.89
5.6.300.0060.00614.62
5.6.290.0040.01114.85
5.6.280.0080.02616.91
5.6.270.0030.00814.87
5.6.260.0040.00814.83
5.6.250.0080.00614.82
5.6.240.0030.01114.87
5.6.230.0080.00514.82
5.6.220.0030.01214.82
5.6.210.0060.03516.74
5.6.200.0060.03316.00
5.6.190.0050.02016.67
5.6.180.0100.01816.66
5.6.170.0140.02716.80
5.6.160.0070.03116.77
5.6.150.0070.03015.92
5.6.140.0060.01815.97
5.6.130.0030.02615.95
5.6.120.0100.02116.85
5.6.110.0050.02016.86
5.6.100.0060.01816.89
5.6.90.0030.01916.91
5.6.80.0090.02816.65
5.6.70.0060.00614.70
5.6.60.0070.00514.84
5.6.50.0060.00614.79
5.6.40.0050.00814.83
5.6.30.0050.00714.72
5.6.20.0050.01014.66
5.6.10.0070.00914.81
5.6.00.0060.00914.86
5.5.380.0050.00714.60
5.5.370.0080.00814.72
5.5.360.0030.01014.79
5.5.350.0100.03016.65
5.5.340.0090.02715.85
5.5.330.0060.03116.65
5.5.320.0110.02016.66
5.5.310.0150.02516.69
5.5.300.0080.01615.79
5.5.290.0080.01815.76
5.5.280.0070.02216.74
5.5.270.0040.03016.79
5.5.260.0110.01816.85
5.5.250.0030.03616.69
5.5.240.0160.02416.59
5.5.230.0070.00814.80
5.5.220.0070.00514.79
5.5.210.0030.01214.78
5.5.200.0050.00914.87
5.5.190.0090.00714.71
5.5.180.0060.00914.66
5.5.170.0060.00814.77
5.5.160.0020.01314.60
5.5.150.0040.00914.74
5.5.140.0030.01014.70
5.5.130.0050.00814.68
5.5.120.0020.01314.76
5.5.110.0070.00714.65
5.5.100.0050.00814.76
5.5.90.0060.00814.71
5.5.80.0020.00814.84
5.5.70.0050.00914.79
5.5.60.0090.00714.71
5.5.50.0090.00614.85
5.5.40.0120.00414.79
5.5.30.0060.00814.59
5.5.20.0000.01314.78
5.5.10.0070.00714.79
5.5.00.0060.01014.77
5.4.450.0270.02215.33
5.4.440.0330.02215.14
5.4.430.0330.02515.23
5.4.420.0220.00515.31
5.4.410.0240.00315.29
5.4.400.0280.00415.26
5.4.390.0220.00515.24
5.4.380.0230.00615.06
5.4.370.0280.00615.09
5.4.360.0210.00615.16
5.4.350.0310.00515.13
5.4.340.0070.01512.79
5.4.330.0020.00613.14
5.4.320.0030.02112.92
5.4.310.0020.02112.92
5.4.300.0060.01512.90
5.4.290.0070.01613.01
5.4.280.0060.01912.90
5.4.270.0040.01512.81
5.4.260.0020.01812.82
5.4.250.0020.01812.81
5.4.240.0060.01512.90
5.4.230.0030.01812.87
5.4.220.0050.02212.87
5.4.210.0070.01912.95
5.4.200.0060.01912.94
5.4.190.0070.01912.83
5.4.180.0070.01512.86
5.4.170.0060.01612.89
5.4.160.0030.01912.85
5.4.150.0040.01912.91
5.4.140.0020.01712.77
5.4.130.0040.01612.73
5.4.120.0060.01712.68
5.4.110.0060.01512.80
5.4.100.0060.01612.75
5.4.90.0050.01512.78
5.4.80.0050.01712.79
5.4.70.0100.01212.80
5.4.60.0060.01612.77
5.4.50.0050.01512.79
5.4.40.0030.01812.68
5.4.30.0040.02012.74
5.4.20.0060.01612.69
5.4.10.0040.01812.72
5.4.00.0030.01912.67
5.3.290.0120.03412.80
5.3.280.0060.04212.71
5.3.270.0070.04312.73
5.3.260.0040.04212.72
5.3.250.0040.04112.72
5.3.240.0100.03312.72
5.3.230.0100.03412.71
5.3.220.0120.03112.68
5.3.210.0060.04212.68
5.3.200.0100.03612.68
5.3.190.0070.04012.68
5.3.180.0030.04112.67
5.3.170.0060.04012.67
5.3.160.0070.04012.68
5.3.150.0030.04412.67
5.3.140.0130.04212.66
5.3.130.0100.03912.66
5.3.120.0060.04712.66
5.3.110.0090.04112.66
5.3.100.0060.03912.13
5.3.90.0080.03712.11
5.3.80.0090.03412.11
5.3.70.0080.03612.11
5.3.60.0050.03912.09
5.3.50.0060.03712.04
5.3.40.0090.04012.04
5.3.30.0090.03312.00
5.3.20.0090.03311.77
5.3.10.0060.03811.74
5.3.00.0040.03711.73
5.2.170.0030.0329.23
5.2.160.0080.0259.23
5.2.150.0030.0329.23
5.2.140.0070.0299.23
5.2.130.0060.0279.19
5.2.120.0060.0309.19
5.2.110.0040.0309.20
5.2.100.0050.0329.19
5.2.90.0090.0279.19
5.2.80.0080.0339.19
5.2.70.0040.0349.19
5.2.60.0060.0359.14
5.2.50.0030.0399.11
5.2.40.0090.0329.09
5.2.30.0100.0309.06
5.2.20.0070.0289.05
5.2.10.0070.0268.96
5.2.00.0050.0318.82
5.1.60.0040.0318.10
5.1.50.0070.0238.11
5.1.40.0030.0288.08
5.1.30.0070.0238.43
5.1.20.0090.0238.45
5.1.10.0060.0248.18
5.1.00.0080.0228.18
5.0.50.0040.0206.66
5.0.40.0040.0196.52
5.0.30.0060.0296.33
5.0.20.0080.0156.32
5.0.10.0100.0166.30
5.0.00.0120.0266.29
4.4.90.0010.0194.78
4.4.80.0050.0144.75
4.4.70.0010.0174.75
4.4.60.0030.0174.76
4.4.50.0050.0134.77
4.4.40.0030.0264.71
4.4.30.0010.0184.76
4.4.20.0040.0164.85
4.4.10.0030.0154.85
4.4.00.0030.0244.76
4.3.110.0030.0154.67
4.3.100.0040.0134.67
4.3.90.0040.0134.63
4.3.80.0020.0264.58
4.3.70.0050.0134.63
4.3.60.0000.0184.63
4.3.50.0030.0154.63
4.3.40.0030.0274.54
4.3.30.0040.0153.30
4.3.20.0010.0193.28
4.3.10.0020.0173.23
4.3.00.0070.0237.23

preferences:
43.9 ms | 401 KiB | 5 Q