3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ [1, 'xxx', 'yyy'], [2, 'xxx', 'yyy'], [3, 'xxx', 'yyy'], [4, 'xxx', 'yyy'], [5, 'xxx', 'yyy'], [6, 'xxx', 'yyy'], [7, 'xxx', 'yyy'], [8, 'xxx', 'yyy'], [9, 'xxx', 'yyy'], [10, 'xxx', 'yyy'], [11, 'xxx', 'yyy'], [12, 'xxx', 'yyy'], [13, 'xxx', 'yyy'], [14, 'xxx', 'yyy'], [15, 'xxx', 'yyy'], [16, 'xxx', 'yyy'], [17, 'xxx', 'yyy'], [18, 'xxx', 'yyy'], [19, 'xxx', 'yyy'] ]; $t = microtime(true); $result = array_map(function($v){ return $v[0]; }, $array); echo number_format(microtime(true) - $t, 3), PHP_EOL; $t = microtime(true); $result = array(); foreach($array as $v)$result[] = $v[0]; echo number_format(microtime(true) - $t, 3), PHP_EOL; ?>

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)
7.1.70.0030.00717.04
7.1.60.0180.00719.33
7.1.50.0080.00317.10
7.1.00.0000.08022.27
7.0.200.0040.00416.79
7.0.140.0070.06722.09
7.0.100.0400.07319.98
7.0.90.0300.07719.94
7.0.80.0070.05319.91
7.0.70.0130.07019.93
7.0.60.0170.08020.00
7.0.50.0200.07720.27
7.0.40.0100.08320.13
7.0.30.0200.07320.01
7.0.20.0130.07720.05
7.0.10.0100.07320.03
7.0.00.0170.07320.13
5.6.280.0070.06720.87
5.6.250.0100.07720.59
5.6.240.0130.07020.68
5.6.230.0070.08020.64
5.6.220.0100.06320.69
5.6.210.0070.08020.57
5.6.200.0130.08321.04
5.6.190.0130.07321.02
5.6.180.0070.08321.09
5.6.170.0030.08021.08
5.6.160.0170.06721.10
5.6.150.0100.08021.03
5.6.140.0100.04721.03
5.6.130.0130.08021.02
5.6.120.0030.09321.12
5.6.110.0170.07320.98
5.6.100.0070.04321.04
5.6.90.0200.06321.04
5.6.80.0070.04720.49
5.6.70.0130.07020.39
5.6.60.0030.08720.30
5.6.50.0100.07320.48
5.6.40.0100.06720.48
5.6.30.0130.07020.43
5.6.20.0070.07720.32
5.6.10.0100.08020.50
5.6.00.0030.04720.41
5.5.380.0130.07320.34
5.5.370.0100.07720.41
5.5.360.0070.07720.43
5.5.350.0000.07720.46
5.5.340.0130.07720.93
5.5.330.0130.07320.93
5.5.320.0070.08720.94
5.5.310.0270.06320.87
5.5.300.0070.08320.90
5.5.290.0100.08020.86
5.5.280.0030.06320.90
5.5.270.0070.08320.91
5.5.260.0200.07020.78
5.5.250.0070.07720.58
5.5.240.0130.06320.20
5.5.230.0070.07720.28
5.5.220.0100.07320.19
5.5.210.0130.07020.29
5.5.200.0100.04720.13
5.5.190.0070.07320.00
5.5.180.0070.08020.16
5.5.160.0070.07020.25
5.5.150.0070.07320.16
5.5.140.0130.07720.24
5.5.130.0030.08020.24
5.5.120.0070.05020.09
5.5.110.0070.07720.12
5.5.100.0000.05320.17
5.5.90.0100.07020.17
5.5.80.0070.07719.93
5.5.70.0170.03719.93
5.5.60.0170.06720.00
5.5.50.0170.07020.06
5.5.40.0130.07020.04
5.5.30.0100.07019.94
5.5.20.0070.06720.07
5.5.10.0070.08020.12
5.5.00.0070.06320.11
5.4.450.0030.05319.38
5.4.440.0100.07019.31
5.4.430.0070.08019.45
5.4.420.0000.05719.53
5.4.410.0130.07019.33
5.4.400.0070.07019.05
5.4.390.0000.08319.23
5.4.380.0070.07719.10
5.4.370.0070.07319.14
5.4.360.0170.07318.94
5.4.350.0070.07719.21
5.4.340.0070.07719.30
5.4.320.0030.07719.23
5.4.310.0030.07019.30
5.4.300.0070.07019.09
5.4.290.0070.05019.21
5.4.280.0030.08019.09
5.4.270.0100.07718.91
5.4.260.0070.05319.13
5.4.250.0070.03719.26
5.4.240.0070.07719.09
5.4.230.0030.06318.91
5.4.220.0030.06719.13
5.4.210.0070.03719.20
5.4.200.0130.06719.01
5.4.190.0070.07319.09
5.4.180.0100.06719.00
5.4.170.0070.07318.90
5.4.160.0030.08319.18
5.4.150.0030.08019.02
5.4.140.0070.06316.45
5.4.130.0100.06716.47
5.4.120.0000.08016.43
5.4.110.0000.07316.51
5.4.100.0070.06716.46
5.4.90.0170.06016.50
5.4.80.0100.07016.43
5.4.70.0130.06316.46
5.4.60.0200.06016.39
5.4.50.0030.06716.37
5.4.40.0130.05716.54
5.4.30.0100.07316.44
5.4.20.0030.07316.52
5.4.10.0030.06016.38
5.4.00.0000.07715.97
5.3.290.0030.07714.58
5.3.280.0030.09014.59
5.3.270.0030.08314.61
5.3.260.0070.04014.52
5.3.250.0030.07714.57
5.3.240.0000.09014.52
5.3.230.0030.05314.58
5.3.220.0030.04714.55
5.3.210.0030.07714.52
5.3.200.0100.07714.57
5.3.190.0030.05714.48
5.3.180.0100.07314.42
5.3.170.0070.07314.57
5.3.160.0070.04714.42
5.3.150.0130.05714.43
5.3.140.0070.06314.55
5.3.130.0130.07314.50
5.3.120.0070.04314.53
5.3.110.0100.07714.53
5.3.100.0100.06714.03
5.3.90.0130.07013.85
5.3.80.0130.06313.88
5.3.70.0070.07313.98
5.3.60.0070.07313.99
5.3.50.0100.07313.91
5.3.40.0000.08013.75
5.3.30.0030.07313.87
5.3.20.0170.06013.47
5.3.10.0030.06013.59
5.3.00.0100.06713.62
5.2.170.0100.03011.11
5.2.160.0030.06311.14
5.2.150.0070.05711.09
5.2.140.0100.05710.98
5.2.130.0070.03311.09
5.2.120.0030.05311.10
5.2.110.0100.02311.10
5.2.100.0100.05011.11
5.2.90.0070.03310.96
5.2.80.0000.06711.16
5.2.70.0000.06310.89
5.2.60.0100.05311.11
5.2.50.0100.06011.05
5.2.40.0030.06010.98
5.2.30.0030.06010.93
5.2.20.0070.06010.92
5.2.10.0030.03710.86
5.2.00.0070.05710.76
5.1.60.0070.04710.71
5.1.50.0100.05010.71
5.1.40.0000.05710.71
5.1.30.0100.05010.71
5.1.20.0070.05010.71
5.1.10.0030.06010.71
5.1.00.0030.05310.71
5.0.50.0000.03710.71
5.0.40.0000.03310.71
5.0.30.0000.06010.71
5.0.20.0070.03710.71
5.0.10.0030.04310.71
5.0.00.0000.03710.71
4.4.90.0030.03010.71
4.4.80.0030.03310.71
4.4.70.0000.03310.71
4.4.60.0000.02310.71
4.4.50.0000.03710.71
4.4.40.0030.03010.71
4.4.30.0100.03010.71
4.4.20.0000.03710.71
4.4.10.0030.03310.71
4.4.00.0000.05310.71
4.3.110.0030.01710.71
4.3.100.0070.02310.71
4.3.90.0070.01710.71
4.3.80.0000.03710.71
4.3.70.0070.02710.71
4.3.60.0000.03310.71
4.3.50.0030.03310.71
4.3.40.0030.04310.71
4.3.30.0000.03710.71
4.3.20.0030.03310.71
4.3.10.0030.03710.71
4.3.00.0030.01710.71

preferences:
38.89 ms | 401 KiB | 5 Q