3v4l.org

run code in 300+ PHP versions simultaneously
<?php function gen_map($f, $iter) { foreach ($iter as $k => $v) { yield $k => $f($v); } } // example: function times_two($x) { return $x * 2; } $source = new ArrayIterator([0, 1, 2, 3, 4, 5, 6]); //var_dump(iterator_to_array(iter_map('times_two', $source))); print_r(iterator_to_array(gen_map('times_two', $source)));

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.0160.00318.43
8.3.50.0160.00521.27
8.3.40.0110.00418.89
8.3.30.0100.00320.39
8.3.20.0050.00318.79
8.3.10.0090.00021.08
8.3.00.0030.00622.40
8.2.180.0140.00716.63
8.2.170.0110.00422.96
8.2.160.0100.01020.52
8.2.150.0040.00424.18
8.2.140.0000.00824.66
8.2.130.0000.00726.16
8.2.120.0030.00619.38
8.2.110.0090.00022.20
8.2.100.0040.00817.72
8.2.90.0050.00319.21
8.2.80.0080.00017.97
8.2.70.0060.00317.50
8.2.60.0040.00417.79
8.2.50.0040.00418.10
8.2.40.0070.00018.09
8.2.30.0030.00319.55
8.2.20.0040.00417.70
8.2.10.0020.00517.82
8.2.00.0040.00417.75
8.1.280.0130.00725.92
8.1.270.0040.00423.99
8.1.260.0040.00426.35
8.1.250.0000.00828.09
8.1.240.0040.00423.91
8.1.230.0110.00017.77
8.1.220.0050.00317.74
8.1.210.0050.00318.77
8.1.200.0060.00317.47
8.1.190.0000.00817.23
8.1.180.0000.00718.10
8.1.170.0040.00418.62
8.1.160.0000.00718.90
8.1.150.0030.00618.66
8.1.140.0040.00417.38
8.1.130.0030.00317.87
8.1.120.0050.00217.50
8.1.110.0040.00417.46
8.1.100.0030.00317.48
8.1.90.0070.00017.49
8.1.80.0050.00217.34
8.1.70.0000.00717.38
8.1.60.0000.00817.48
8.1.50.0040.00417.50
8.1.40.0040.00417.41
8.1.30.0040.00417.47
8.1.20.0000.00817.49
8.1.10.0070.00017.49
8.1.00.0030.00617.45
8.0.300.0070.00018.77
8.0.290.0040.00416.63
8.0.280.0000.00718.50
8.0.270.0000.00717.17
8.0.260.0060.00316.68
8.0.250.0040.00416.96
8.0.240.0040.00416.96
8.0.230.0000.00816.97
8.0.220.0030.00316.78
8.0.210.0040.00416.86
8.0.200.0000.00616.95
8.0.190.0000.00716.96
8.0.180.0040.00416.95
8.0.170.0070.00016.81
8.0.160.0000.00716.95
8.0.150.0030.00316.95
8.0.140.0050.00516.87
8.0.130.0000.00613.35
8.0.120.0000.00816.86
8.0.110.0040.00416.90
8.0.100.0040.00416.71
8.0.90.0000.00716.95
8.0.80.0030.01616.94
8.0.70.0050.00316.71
8.0.60.0040.00416.74
8.0.50.0080.00017.01
8.0.30.0120.01017.22
8.0.20.0090.00917.40
8.0.10.0000.00816.98
8.0.00.0090.01016.82
7.4.330.0020.00216.78
7.4.320.0030.00316.61
7.4.300.0000.00616.59
7.4.290.0070.00016.51
7.4.280.0050.00216.45
7.4.270.0030.00316.54
7.4.260.0050.00013.32
7.4.250.0000.00816.46
7.4.240.0070.00016.50
7.4.230.0030.00316.54
7.4.220.0090.01216.55
7.4.210.0100.00516.50
7.4.200.0070.00016.66
7.4.190.0000.00816.40
7.4.160.0090.01216.61
7.4.150.0130.00317.40
7.4.140.0120.00817.86
7.4.130.0110.00516.47
7.4.120.0080.01316.61
7.4.110.0070.01016.48
7.4.100.0120.00616.34
7.4.90.0130.00316.57
7.4.80.0090.01419.39
7.4.70.0100.01316.51
7.4.60.0130.00316.50
7.4.50.0050.00016.52
7.4.40.0000.01522.77
7.4.30.0100.00716.45
7.4.00.0080.00814.94
7.3.330.0000.00513.32
7.3.320.0000.00513.14
7.3.310.0070.00016.27
7.3.300.0060.00016.23
7.3.290.0030.01216.39
7.3.280.0100.00716.40
7.3.270.0120.00617.40
7.3.260.0130.00518.24
7.3.250.0100.00716.39
7.3.240.0160.00316.65
7.3.230.0100.00716.63
7.3.210.0030.01416.38
7.3.200.0150.00919.39
7.3.190.0100.01116.52
7.3.180.0030.01316.48
7.3.170.0080.00816.44
7.3.160.0080.01116.64
7.3.120.0020.01614.94
7.3.110.0060.00914.99
7.3.100.0070.00714.92
7.3.90.0110.00714.80
7.3.80.0030.00914.76
7.3.70.0120.00314.77
7.3.60.0080.00614.83
7.3.50.0040.00714.97
7.3.40.0090.00614.91
7.3.30.0080.00414.79
7.3.20.0130.00316.44
7.3.10.0030.01416.67
7.3.00.0070.00716.69
7.2.330.0060.01316.70
7.2.320.0140.00416.73
7.2.310.0090.01316.77
7.2.300.0100.00616.68
7.2.290.0110.00716.61
7.2.250.0080.01115.26
7.2.240.0160.00315.06
7.2.230.0130.00714.98
7.2.220.0100.00315.04
7.2.210.0100.00715.17
7.2.200.0060.00615.22
7.2.190.0070.00314.80
7.2.180.0070.00714.82
7.2.170.0080.00415.20
7.2.00.0040.00719.07
7.1.330.0000.01515.81
7.1.320.0080.00815.77
7.1.310.0000.01515.98
7.1.300.0030.00915.71
7.1.290.0030.01015.58
7.1.280.0060.00616.02
7.1.270.0100.00315.54
7.1.260.0030.01315.57
7.1.100.0000.00918.10
7.1.70.0070.00717.00
7.1.60.0070.01819.17
7.1.50.0130.01016.91
7.1.00.0000.07022.41
7.0.200.0030.00616.86
7.0.140.0070.07021.92
7.0.100.0200.05020.02
7.0.90.0070.04719.88
7.0.80.0230.07719.93
7.0.70.0130.03720.02
7.0.60.0000.04719.86
7.0.50.0130.04020.24
7.0.40.0100.03720.11
7.0.30.0000.05320.02
7.0.20.0070.09020.05
7.0.10.0130.04320.05
7.0.00.0130.03020.17
5.6.280.0030.07321.09
5.6.250.0100.04020.62
5.6.240.0070.07320.51
5.6.230.0170.07320.72
5.6.220.0100.08720.50
5.6.210.0070.07720.77
5.6.200.0100.04021.04
5.6.190.0030.04720.96
5.6.180.0100.03720.95
5.6.170.0130.03021.08
5.6.160.0030.08320.96
5.6.150.0070.06721.11
5.6.140.0130.03321.17
5.6.130.0070.04721.01
5.6.120.0100.04021.04
5.6.110.0030.04320.95
5.6.100.0100.03321.03
5.6.90.0100.04021.02
5.6.80.0030.04020.32
5.6.70.0030.04020.52
5.6.60.0070.03720.33
5.6.50.0100.03720.41
5.6.40.0000.04320.30
5.6.30.0000.04320.30
5.6.20.0030.04320.41
5.6.10.0000.04320.49
5.6.00.0100.03320.32
5.5.380.0070.07720.51
5.5.370.0000.05320.36
5.5.360.0170.03020.56
5.5.350.0100.03720.46
5.5.340.0030.05020.73
5.5.330.0100.03720.63
5.5.320.0070.04020.91
5.5.310.0030.04320.77
5.5.300.0000.04320.76
5.5.290.0030.04320.78
5.5.280.0100.03720.86
5.5.270.0030.04320.89
5.5.260.0070.04320.88
5.5.250.0000.05020.70
5.5.240.0100.03720.26
5.5.230.0000.04320.27
5.5.220.0070.03720.10
5.5.210.0030.04320.27
5.5.200.0030.04020.23
5.5.190.0070.03720.25
5.5.180.0070.03720.18
5.5.160.0070.04320.13
5.5.150.0100.03720.26
5.5.140.0030.03720.07
5.5.130.0030.04320.18
5.5.120.0100.02720.14
5.5.110.0070.03719.96
5.5.100.0000.03719.91
5.5.90.0070.04020.10
5.5.80.0130.06720.15
5.5.70.0130.06020.14
5.5.60.0070.05720.16
5.5.50.0100.04320.02
5.5.40.0100.07719.94
5.5.30.0070.05720.03
5.5.20.0100.04320.05
5.5.10.0000.09020.07
5.5.00.0130.06320.02
5.4.450.0000.04719.23
5.4.440.0030.04019.21
5.4.430.0000.04319.45
5.4.420.0070.04319.20
5.4.410.0030.04019.07
5.4.400.0000.04019.21
5.4.390.0070.04019.13
5.4.380.0030.03718.96
5.4.370.0000.04018.96
5.4.360.0070.03719.23
5.4.350.0000.04018.91
5.4.340.0030.03719.13
5.4.320.0000.04319.21
5.4.310.0070.03318.87
5.4.300.0070.03319.21
5.4.290.0000.04019.09
5.4.280.0170.02719.07
5.4.270.0030.04018.90
5.4.260.0000.03319.09
5.4.250.0070.02719.17
5.4.240.0030.04719.09
5.4.230.0070.06019.11
5.4.220.0130.06019.22
5.4.210.0070.03719.16
5.4.200.0200.02719.18
5.4.190.0070.04719.16
5.4.180.0130.07719.22
5.4.170.0100.06319.07
5.4.160.0130.07019.18
5.4.150.0100.03719.14
5.4.140.0000.05016.46
5.4.130.0070.03016.41
5.4.120.0070.07316.47
5.4.110.0070.03316.43
5.4.100.0030.07016.34
5.4.90.0130.05316.32
5.4.80.0000.03716.33
5.4.70.0100.07016.45
5.4.60.0000.03716.25
5.4.50.0070.05716.47
5.4.40.0170.05016.50
5.4.30.0070.07316.34
5.4.20.0070.04316.48
5.4.10.0100.06716.47
5.4.00.0030.07715.94
5.3.290.0000.04014.64
5.3.280.0000.07014.52
5.3.270.0030.07314.64
5.3.260.0030.08014.64
5.3.250.0070.06314.61
5.3.240.0030.07714.59
5.3.230.0100.07014.55
5.3.220.0070.07714.69
5.3.210.0100.03314.55
5.3.200.0070.07314.52
5.3.190.0100.05314.69
5.3.180.0070.08014.57
5.3.170.0030.08014.63
5.3.160.0030.05714.56
5.3.150.0130.07014.54
5.3.140.0070.07714.54
5.3.130.0100.06714.60
5.3.120.0030.04014.61
5.3.110.0030.06314.64
5.3.100.0070.07714.10
5.3.90.0170.05714.09
5.3.80.0030.05713.90
5.3.70.0030.04014.07
5.3.60.0030.08013.98
5.3.50.0070.07013.95
5.3.40.0000.08014.05
5.3.30.0000.05313.97
5.3.20.0030.04313.72
5.3.10.0100.07013.64
5.3.00.0030.08013.64
5.2.170.0070.06013.46
5.2.160.0030.05713.46
5.2.150.0030.05713.46
5.2.140.0000.04013.46
5.2.130.0070.05713.46
5.2.120.0030.06013.46
5.2.110.0000.05013.46
5.2.100.0000.04013.46
5.2.90.0070.03713.46
5.2.80.0100.05713.46
5.2.70.0070.06313.46
5.2.60.0070.06013.46
5.2.50.0030.06313.46
5.2.40.0100.05713.46
5.2.30.0070.03013.46
5.2.20.0030.06313.46
5.2.10.0000.05713.46
5.2.00.0070.05313.46
5.1.60.0030.03013.46
5.1.50.0000.05713.46
5.1.40.0070.04013.46
5.1.30.0000.03313.46
5.1.20.0000.04313.46
5.1.10.0030.05313.46
5.1.00.0030.03013.46
5.0.50.0030.04713.46
5.0.40.0100.01713.46
5.0.30.0000.03313.46
5.0.20.0030.03013.46
5.0.10.0030.03713.46
5.0.00.0070.03713.46
4.4.90.0100.02013.46
4.4.80.0000.02013.46
4.4.70.0000.03313.46
4.4.60.0130.01713.46
4.4.50.0000.03313.46
4.4.40.0000.04713.46
4.4.30.0000.03713.46
4.4.20.0000.02713.46
4.4.10.0030.01313.46
4.4.00.0130.04713.46
4.3.110.0030.03313.46
4.3.100.0030.03313.46
4.3.90.0070.02713.46
4.3.80.0030.05313.46
4.3.70.0070.02013.46
4.3.60.0100.01013.46
4.3.50.0100.01013.46
4.3.40.0000.05713.46
4.3.30.0070.03313.46
4.3.20.0000.03713.46
4.3.10.0100.02313.46
4.3.00.0000.02013.46

preferences:
55.38 ms | 401 KiB | 5 Q