3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $classmap1 = array(); for ($i=1; $i<=15000; $i++) { $classmap1['a'.$i] = $i+1; } $classmap2 = array(); for ($i=1; $i<=15000; $i++) { $classmap2['b'.$i] = $i+1; } abstract class merging { public static function merge(array $a, array &$b) { foreach ($b as $key => $value) { if (isset($a[$key])) { if (is_int($key)) { $a[] = $value; } elseif (is_array($value) && is_array($a[$key])) { $a[$key] = static::merge($a[$key], $value); } else { $a[$key] = $value; } } else { $a[$key] = $value; } } return $a; } } $startTimeFunc = microtime(true); merging::merge($classmap1, $classmap2); $endTimeFunc = microtime(true); echo "Func took " . (($endTimeFunc - $startTimeFunc)*1000) ." microseconds<br />\n";
Output for 7.1.0
Func took 1.5978813171387 microseconds<br />
Output for 7.0.14
Func took 1.5280246734619 microseconds<br />
Output for 7.0.9
Func took 1.6250610351562 microseconds<br />
Output for 7.0.8
Func took 2.0151138305664 microseconds<br />
Output for 7.0.7
Func took 1.460075378418 microseconds<br />
Output for 7.0.6
Func took 1.4891624450684 microseconds<br />
Output for 7.0.5
Func took 1.5020370483398 microseconds<br />
Output for 7.0.4
Func took 1.2800693511963 microseconds<br />
Output for 7.0.3
Func took 2.3260116577148 microseconds<br />
Output for 7.0.2
Func took 1.1007785797119 microseconds<br />
Output for 7.0.1
Func took 1.3680458068848 microseconds<br />
Output for 7.0.0
Func took 1.5289783477783 microseconds<br />
Output for 5.6.28
Func took 6.5431594848633 microseconds<br />
Output for 5.6.23
Func took 5.7859420776367 microseconds<br />
Output for 5.6.22
Func took 5.0699710845947 microseconds<br />
Output for 5.6.21
Func took 5.5568218231201 microseconds<br />
Output for 5.6.20
Func took 4.4629573822021 microseconds<br />
Output for 5.6.19
Func took 5.5959224700928 microseconds<br />
Output for 5.6.18
Func took 5.0449371337891 microseconds<br />
Output for 5.6.17
Func took 4.5778751373291 microseconds<br />
Output for 5.6.16
Func took 6.9839954376221 microseconds<br />
Output for 5.6.15
Func took 5.0489902496338 microseconds<br />
Output for 5.6.14
Func took 5.7659149169922 microseconds<br />
Output for 5.6.13
Func took 6.5340995788574 microseconds<br />
Output for 5.6.12
Func took 5.0041675567627 microseconds<br />
Output for 5.6.11
Func took 5.5160522460938 microseconds<br />
Output for 5.6.10
Func took 5.1379203796387 microseconds<br />
Output for 5.6.9
Func took 5.6509971618652 microseconds<br />
Output for 5.6.8
Func took 4.8000812530518 microseconds<br />
Output for 5.6.7
Func took 5.1579475402832 microseconds<br />
Output for 5.6.6
Func took 6.4759254455566 microseconds<br />
Output for 5.6.5
Func took 6.9689750671387 microseconds<br />
Output for 5.6.4
Func took 7.3850154876709 microseconds<br />
Output for 5.6.3
Func took 6.0830116271973 microseconds<br />
Output for 5.6.2
Func took 4.0290355682373 microseconds<br />
Output for 5.6.1
Func took 4.3489933013916 microseconds<br />
Output for 5.6.0
Func took 5.3620338439941 microseconds<br />
Output for 5.5.37
Func took 4.9839019775391 microseconds<br />
Output for 5.5.36
Func took 7.0528984069824 microseconds<br />
Output for 5.5.35
Func took 5.7358741760254 microseconds<br />
Output for 5.5.34
Func took 5.4309368133545 microseconds<br />
Output for 5.5.33
Func took 6.0021877288818 microseconds<br />
Output for 5.5.32
Func took 5.5179595947266 microseconds<br />
Output for 5.5.31
Func took 6.2909126281738 microseconds<br />
Output for 5.5.30
Func took 7.1878433227539 microseconds<br />
Output for 5.5.29
Func took 5.3780078887939 microseconds<br />
Output for 5.5.28
Func took 4.9350261688232 microseconds<br />
Output for 5.5.27
Func took 7.48610496521 microseconds<br />
Output for 5.5.26
Func took 4.835844039917 microseconds<br />
Output for 5.5.25
Func took 6.1872005462646 microseconds<br />
Output for 5.5.24
Func took 7.6889991760254 microseconds<br />
Output for 5.5.23
Func took 5.2759647369385 microseconds<br />
Output for 5.5.22
Func took 7.3611736297607 microseconds<br />
Output for 5.5.21
Func took 4.8918724060059 microseconds<br />
Output for 5.5.20
Func took 5.2499771118164 microseconds<br />
Output for 5.5.19
Func took 4.9030780792236 microseconds<br />
Output for 5.5.18
Func took 5.6369304656982 microseconds<br />
Output for 5.5.16
Func took 5.511999130249 microseconds<br />
Output for 5.5.15
Func took 4.8720836639404 microseconds<br />
Output for 5.5.14
Func took 4.9459934234619 microseconds<br />
Output for 5.5.13
Func took 4.7938823699951 microseconds<br />
Output for 5.5.12
Func took 5.626916885376 microseconds<br />
Output for 5.5.11
Func took 4.6138763427734 microseconds<br />
Output for 5.5.10
Func took 4.1308403015137 microseconds<br />
Output for 5.5.9
Func took 6.7169666290283 microseconds<br />
Output for 5.5.8
Func took 3.4167766571045 microseconds<br />
Output for 5.5.7
Func took 5.1779747009277 microseconds<br />
Output for 5.5.6
Func took 4.810094833374 microseconds<br />
Output for 5.5.5
Func took 4.9028396606445 microseconds<br />
Output for 5.5.4
Func took 6.4079761505127 microseconds<br />
Output for 5.5.3
Func took 4.237174987793 microseconds<br />
Output for 5.5.2
Func took 5.925178527832 microseconds<br />
Output for 5.5.1
Func took 3.8871765136719 microseconds<br />
Output for 5.5.0
Func took 4.4589042663574 microseconds<br />
Output for 5.4.41, 5.4.45
Func took 6.1969757080078 microseconds<br />
Output for 5.4.44
Func took 5.3949356079102 microseconds<br />
Output for 5.4.43
Func took 6.4980983734131 microseconds<br />
Output for 5.4.42
Func took 6.450891494751 microseconds<br />
Output for 5.4.40
Func took 6.5789222717285 microseconds<br />
Output for 5.4.39
Func took 7.1151256561279 microseconds<br />
Output for 5.4.38
Func took 8.7850093841553 microseconds<br />
Output for 5.4.37
Func took 4.8060417175293 microseconds<br />
Output for 5.4.36
Func took 6.464958190918 microseconds<br />
Output for 5.4.35
Func took 5.4068565368652 microseconds<br />
Output for 5.4.34
Func took 6.3810348510742 microseconds<br />
Output for 5.4.32
Func took 7.2090625762939 microseconds<br />
Output for 5.4.31
Func took 5.2480697631836 microseconds<br />
Output for 5.4.30
Func took 5.0399303436279 microseconds<br />
Output for 5.4.29
Func took 6.9520473480225 microseconds<br />
Output for 5.4.28
Func took 5.558967590332 microseconds<br />
Output for 5.4.27
Func took 4.5969486236572 microseconds<br />
Output for 5.4.26
Func took 4.8949718475342 microseconds<br />
Output for 5.4.25
Func took 4.755973815918 microseconds<br />
Output for 5.4.24
Func took 5.6061744689941 microseconds<br />
Output for 5.4.23
Func took 4.8179626464844 microseconds<br />
Output for 5.4.22
Func took 4.7979354858398 microseconds<br />
Output for 5.4.21
Func took 4.8689842224121 microseconds<br />
Output for 5.4.20
Func took 4.478931427002 microseconds<br />
Output for 5.4.19
Func took 4.3249130249023 microseconds<br />
Output for 5.4.18
Func took 4.2111873626709 microseconds<br />
Output for 5.4.17
Func took 4.7621726989746 microseconds<br />
Output for 5.4.16
Func took 10.364055633545 microseconds<br />
Output for 5.4.15
Func took 4.7011375427246 microseconds<br />
Output for 5.4.14
Func took 5.8629512786865 microseconds<br />
Output for 5.4.13
Func took 4.9021244049072 microseconds<br />
Output for 5.4.12
Func took 4.7080516815186 microseconds<br />
Output for 5.4.11
Func took 4.8460960388184 microseconds<br />
Output for 5.4.10
Func took 4.1639804840088 microseconds<br />
Output for 5.4.9
Func took 4.7929286956787 microseconds<br />
Output for 5.4.8
Func took 6.9990158081055 microseconds<br />
Output for 5.4.7
Func took 11.619091033936 microseconds<br />
Output for 5.4.6
Func took 6.878137588501 microseconds<br />
Output for 5.4.5
Func took 7.3630809783936 microseconds<br />
Output for 5.4.4
Func took 7.2200298309326 microseconds<br />
Output for 5.4.3
Func took 5.8379173278809 microseconds<br />
Output for 5.4.2
Func took 4.8699378967285 microseconds<br />
Output for 5.4.1
Func took 6.7200660705566 microseconds<br />
Output for 5.4.0
Func took 5.1259994506836 microseconds<br />
Output for 5.3.29
Func took 6.666898727417 microseconds<br />
Output for 5.3.28
Func took 4.7361850738525 microseconds<br />
Output for 5.3.27
Func took 4.6730041503906 microseconds<br />
Output for 5.3.26
Func took 4.5750141143799 microseconds<br />
Output for 5.3.25
Func took 5.885124206543 microseconds<br />
Output for 5.3.24
Func took 5.2990913391113 microseconds<br />
Output for 5.3.23
Func took 4.6238899230957 microseconds<br />
Output for 5.3.22
Func took 4.7640800476074 microseconds<br />
Output for 5.3.21
Func took 4.7109127044678 microseconds<br />
Output for 5.3.20
Func took 4.662036895752 microseconds<br />
Output for 5.3.19
Func took 5.7048797607422 microseconds<br />
Output for 5.3.18
Func took 5.7809352874756 microseconds<br />
Output for 5.3.17
Func took 6.7849159240723 microseconds<br />
Output for 5.3.16
Func took 5.2239894866943 microseconds<br />
Output for 5.3.15
Func took 6.181001663208 microseconds<br />
Output for 5.3.14
Func took 7.3180198669434 microseconds<br />
Output for 5.3.13
Func took 7.4818134307861 microseconds<br />
Output for 5.3.12
Func took 5.6247711181641 microseconds<br />
Output for 5.3.11
Func took 6.8709850311279 microseconds<br />
Output for 5.3.10
Func took 5.9728622436523 microseconds<br />
Output for 5.3.9
Func took 6.5419673919678 microseconds<br />
Output for 5.3.8
Func took 5.9609413146973 microseconds<br />
Output for 5.3.7
Func took 4.8120021820068 microseconds<br />
Output for 5.3.6
Func took 5.6831836700439 microseconds<br />
Output for 5.3.5
Func took 7.2169303894043 microseconds<br />
Output for 5.3.4
Func took 5.3369998931885 microseconds<br />
Output for 5.3.3
Func took 6.7451000213623 microseconds<br />
Output for 5.3.2
Func took 6.1330795288086 microseconds<br />
Output for 5.3.1
Func took 6.9901943206787 microseconds<br />
Output for 5.3.0
Func took 5.7549476623535 microseconds<br />
Output for 5.1.0 - 5.2.17
Parse error: syntax error, unexpected T_STATIC in /in/82R5K on line 21
Process exited with code 255.
Output for 5.0.0 - 5.0.5
Parse error: parse error, unexpected T_ARRAY, expecting '&' or T_VARIABLE in /in/82R5K on line 14
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_CLASS in /in/82R5K on line 13
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected T_CLASS in /in/82R5K on line 13
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/82R5K on line 13
Process exited with code 255.