3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?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'], [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, 10), PHP_EOL; $t = microtime(true); $result = array(); foreach($array as $v)$result[] = $v[0]; echo number_format(microtime(true) - $t, 10), PHP_EOL; ?>
Output for 7.1.0
0.0000100136 0.0000040531
Output for 7.0.14
0.0000100136 0.0000050068
Output for 7.0.12
0.0000109673 0.0000050068
Output for 7.0.6
0.0000119209 0.0000050068
Output for 7.0.5
0.0000109673 0.0000040531
Output for 7.0.4
0.0000090599 0.0000040531
Output for 7.0.3
0.0000071526 0.0000019073
Output for 7.0.2
0.0000119209 0.0000040531
Output for 7.0.1
0.0000081062 0.0000019073
Output for 7.0.0
0.0000112057 0.0000050068
Output for hhvm-3.12.0
0.0000298023 0.0000069141
Output for hhvm-3.10.0
0.0000429153 0.0000100136
Output for 5.4.10, 5.4.28, 5.4.34, 5.6.21
0.0000329018 0.0000109673
Output for 5.4.5, 5.5.27, 5.6.20
0.0000319481 0.0000100136
Output for 5.6.19
0.0000250340 0.0000088215
Output for 5.6.16 - 5.6.18
0.0000200272 0.0000059605
Output for 5.4.14, 5.5.28, 5.6.15
0.0000309944 0.0000100136
Output for 5.6.10, 5.6.14
0.0000200272 0.0000069141
Output for 5.4.25, 5.6.13
0.0000300407 0.0000100136
Output for 5.6.12
0.0000321865 0.0000100136
Output for 5.6.11
0.0000488758 0.0000159740
Output for 5.6.9
0.0000338554 0.0000140667
Output for 5.4.19, 5.6.8
0.0000319481 0.0000109673
Output for 5.5.35
0.0000300407 0.0000090599
Output for 5.5.34
0.0000340939 0.0000109673
Output for 5.4.12, 5.4.42, 5.5.33
0.0000250340 0.0000081062
Output for 5.5.32
0.0000259876 0.0000088215
Output for 5.5.31
0.0000331402 0.0000081062
Output for 5.4.36, 5.5.30
0.0000329018 0.0000100136
Output for 5.5.29
0.0000281334 0.0000140667
Output for 5.5.26
0.0000350475 0.0000150204
Output for 5.5.25
0.0000400543 0.0000109673
Output for 5.4.27, 5.5.24
0.0000259876 0.0000078678
Output for 5.4.45
0.0000178814 0.0000069141
Output for 5.4.44
0.0000190735 0.0000069141
Output for 5.4.43
0.0000190735 0.0000071526
Output for 5.4.41
0.0000288486 0.0000090599
Output for 5.4.40
0.0000278950 0.0000100136
Output for 5.4.39
0.0000319481 0.0000121593
Output for 5.4.38
0.0000250340 0.0000121593
Output for 5.4.37
0.0000329018 0.0000138283
Output for 5.4.35
0.0000240803 0.0000081062
Output for 5.4.32
0.0000209808 0.0000078678
Output for 5.4.31
0.0000450611 0.0000109673
Output for 5.4.30
0.0000238419 0.0000081062
Output for 5.4.29
0.0000319481 0.0000097752
Output for 5.4.26
0.0000360012 0.0000128746
Output for 5.4.24
0.0000340939 0.0000121593
Output for 5.4.23
0.0000381470 0.0000119209
Output for 5.4.22
0.0000231266 0.0000071526
Output for 5.4.21
0.0000329018 0.0000131130
Output for 5.4.20
0.0000231266 0.0000090599
Output for 5.4.18
0.0000331402 0.0000109673
Output for 5.4.17
0.0000228882 0.0000109673
Output for 5.4.16
0.0000259876 0.0000081062
Output for 5.4.2, 5.4.15
0.0000290871 0.0000100136
Output for 5.4.13
0.0000460148 0.0000159740
Output for 5.4.11
0.0000338554 0.0000100136
Output for 5.4.9
0.0000290871 0.0000140667
Output for 5.4.8
0.0000369549 0.0000100136
Output for 5.4.7
0.0000350475 0.0000169277
Output for 5.4.6
0.0000250340 0.0000100136
Output for 5.4.4
0.0000269413 0.0000131130
Output for 5.4.3
0.0000321865 0.0000159740
Output for 5.4.1
0.0000250340 0.0000078678
Output for 5.4.0
0.0000340939 0.0000131130
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/UWnEd on line 2
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected '[' in /in/UWnEd on line 2
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/UWnEd on line 2
Process exited with code 255.