3v4l.org

run code in 300+ PHP versions simultaneously
<?php $classmap1 = array(); for ($i=1; $i<=5000; $i++) { $classmap1['a'.$i] = $i+1; } $classmap2 = array(); for ($i=1; $i<=5000; $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.2.22, 7.4.1
Func took 0.77295303344727 microseconds<br />
Output for 7.0.1, 7.4.0
Func took 0.78201293945312 microseconds<br />
Output for 7.3.13
Func took 0.77199935913086 microseconds<br />
Output for 7.3.12
Func took 0.59986114501953 microseconds<br />
Output for 7.3.11
Func took 0.76985359191895 microseconds<br />
Output for 7.3.5, 7.3.10
Func took 0.72598457336426 microseconds<br />
Output for 7.3.9
Func took 0.7169246673584 microseconds<br />
Output for 7.3.8
Func took 0.52618980407715 microseconds<br />
Output for 7.3.7
Func took 0.71811676025391 microseconds<br />
Output for 7.3.6
Func took 0.57792663574219 microseconds<br />
Output for 7.3.4
Func took 0.72002410888672 microseconds<br />
Output for 7.3.3
Func took 0.54001808166504 microseconds<br />
Output for 7.3.2
Func took 0.53501129150391 microseconds<br />
Output for 7.3.1
Func took 0.51403045654297 microseconds<br />
Output for 7.3.0
Func took 0.61511993408203 microseconds<br />
Output for 7.0.14, 7.2.26
Func took 0.74601173400879 microseconds<br />
Output for 7.2.25
Func took 0.78701972961426 microseconds<br />
Output for 7.2.24
Func took 0.63300132751465 microseconds<br />
Output for 7.2.23
Func took 0.75387954711914 microseconds<br />
Output for 7.0.5, 7.2.21
Func took 0.78105926513672 microseconds<br />
Output for 7.2.20
Func took 0.91099739074707 microseconds<br />
Output for 7.2.19
Func took 0.54693222045898 microseconds<br />
Output for 7.2.18
Func took 0.72979927062988 microseconds<br />
Output for 7.1.19, 7.1.23, 7.2.17
Func took 0.84400177001953 microseconds<br />
Output for 7.2.16
Func took 0.55384635925293 microseconds<br />
Output for 7.2.15
Func took 0.56314468383789 microseconds<br />
Output for 7.2.14
Func took 0.65302848815918 microseconds<br />
Output for 7.2.13
Func took 0.69808959960938 microseconds<br />
Output for 7.2.12
Func took 0.55098533630371 microseconds<br />
Output for 7.2.11
Func took 0.89097023010254 microseconds<br />
Output for 7.2.10
Func took 0.60796737670898 microseconds<br />
Output for 7.2.9
Func took 0.56815147399902 microseconds<br />
Output for 7.2.2, 7.2.8
Func took 0.63610076904297 microseconds<br />
Output for 7.2.7
Func took 0.53000450134277 microseconds<br />
Output for 7.2.6
Func took 0.7321834564209 microseconds<br />
Output for 7.2.5
Func took 0.64611434936523 microseconds<br />
Output for 7.1.21, 7.2.4
Func took 0.75292587280273 microseconds<br />
Output for 7.2.3
Func took 0.64992904663086 microseconds<br />
Output for 7.2.1
Func took 0.69999694824219 microseconds<br />
Output for 7.2.0
Func took 0.66804885864258 microseconds<br />
Output for 7.1.33
Func took 0.89502334594727 microseconds<br />
Output for 7.1.32
Func took 0.89192390441895 microseconds<br />
Output for 7.1.31
Func took 0.93603134155273 microseconds<br />
Output for 7.0.4, 7.1.30
Func took 0.78296661376953 microseconds<br />
Output for 7.1.29
Func took 0.84185600280762 microseconds<br />
Output for 7.1.28
Func took 0.81586837768555 microseconds<br />
Output for 7.1.27
Func took 0.69785118103027 microseconds<br />
Output for 7.0.28, 7.1.7, 7.1.26
Func took 0.76603889465332 microseconds<br />
Output for 7.1.25
Func took 0.69117546081543 microseconds<br />
Output for 7.1.24
Func took 0.69689750671387 microseconds<br />
Output for 7.1.22
Func took 0.87904930114746 microseconds<br />
Output for 7.1.20
Func took 0.67400932312012 microseconds<br />
Output for 7.1.18
Func took 0.70905685424805 microseconds<br />
Output for 7.1.17
Func took 1.2478828430176 microseconds<br />
Output for 7.1.14, 7.1.16
Func took 0.75602531433105 microseconds<br />
Output for 7.1.15
Func took 0.7021427154541 microseconds<br />
Output for 7.1.13
Func took 0.94389915466309 microseconds<br />
Output for 7.1.12
Func took 1.2531280517578 microseconds<br />
Output for 7.1.11
Func took 0.82707405090332 microseconds<br />
Output for 7.1.10
Func took 1.0581016540527 microseconds<br />
Output for 7.1.9
Func took 0.82802772521973 microseconds<br />
Output for 7.1.8
Func took 0.69904327392578 microseconds<br />
Output for 7.1.6
Func took 0.79011917114258 microseconds<br />
Output for 7.1.5
Func took 0.80108642578125 microseconds<br />
Output for 7.1.4
Func took 1.2011528015137 microseconds<br />
Output for 7.1.3
Func took 0.7929801940918 microseconds<br />
Output for 7.1.2
Func took 0.93507766723633 microseconds<br />
Output for 7.1.1
Func took 0.82898139953613 microseconds<br />
Output for 7.1.0
Func took 0.72693824768066 microseconds<br />
Output for 7.0.33
Func took 0.72908401489258 microseconds<br />
Output for 7.0.32
Func took 0.92101097106934 microseconds<br />
Output for 7.0.31
Func took 1.0621547698975 microseconds<br />
Output for 7.0.30
Func took 0.96297264099121 microseconds<br />
Output for 7.0.29
Func took 0.76889991760254 microseconds<br />
Output for 7.0.27
Func took 0.96797943115234 microseconds<br />
Output for 7.0.26
Func took 0.99015235900879 microseconds<br />
Output for 7.0.25
Func took 1.1968612670898 microseconds<br />
Output for 7.0.24
Func took 0.78487396240234 microseconds<br />
Output for 7.0.23
Func took 1.0311603546143 microseconds<br />
Output for 7.0.22
Func took 0.78511238098145 microseconds<br />
Output for 7.0.21
Func took 0.78010559082031 microseconds<br />
Output for 7.0.20
Func took 0.95701217651367 microseconds<br />
Output for 7.0.19
Func took 0.81205368041992 microseconds<br />
Output for 7.0.18
Func took 0.82087516784668 microseconds<br />
Output for 7.0.17
Func took 1.0061264038086 microseconds<br />
Output for 7.0.16
Func took 1.133918762207 microseconds<br />
Output for 7.0.15
Func took 1.2109279632568 microseconds<br />
Output for 7.0.13
Func took 0.83112716674805 microseconds<br />
Output for 7.0.12
Func took 0.80394744873047 microseconds<br />
Output for 7.0.11
Func took 1.1470317840576 microseconds<br />
Output for 7.0.10
Func took 1.0130405426025 microseconds<br />
Output for 7.0.9
Func took 0.74505805969238 microseconds<br />
Output for 7.0.8
Func took 0.95987319946289 microseconds<br />
Output for 7.0.7
Func took 1.0199546813965 microseconds<br />
Output for 7.0.6
Func took 0.81396102905273 microseconds<br />
Output for 7.0.3
Func took 0.81515312194824 microseconds<br />
Output for 7.0.2
Func took 0.93197822570801 microseconds<br />
Output for 7.0.0
Func took 1.0759830474854 microseconds<br />
Output for 5.6.40
Func took 1.6119480133057 microseconds<br />
Output for 5.6.39
Func took 2.068042755127 microseconds<br />
Output for 5.6.38
Func took 1.9059181213379 microseconds<br />
Output for 5.6.37
Func took 1.6260147094727 microseconds<br />
Output for 5.6.33, 5.6.36
Func took 1.7619132995605 microseconds<br />
Output for 5.6.35
Func took 1.7600059509277 microseconds<br />
Output for 5.6.34
Func took 1.6670227050781 microseconds<br />
Output for 5.6.32
Func took 1.676082611084 microseconds<br />
Output for 5.6.31
Func took 2.1059513092041 microseconds<br />
Output for 5.6.30
Func took 1.6248226165771 microseconds<br />
Output for 5.6.29
Func took 1.7020702362061 microseconds<br />
Output for 5.6.28
Func took 1.8270015716553 microseconds<br />
Output for 5.6.27
Func took 1.8289089202881 microseconds<br />
Output for 5.6.26
Func took 2.1579265594482 microseconds<br />
Output for 5.6.25
Func took 2.1789073944092 microseconds<br />
Output for 5.6.24
Func took 1.6679763793945 microseconds<br />
Output for 5.6.23
Func took 1.7640590667725 microseconds<br />
Output for 5.6.22
Func took 1.939058303833 microseconds<br />
Output for 5.6.21
Func took 1.8250942230225 microseconds<br />
Output for 5.6.20
Func took 1.7120838165283 microseconds<br />
Output for 5.6.19
Func took 1.6570091247559 microseconds<br />
Output for 5.6.18
Func took 1.9450187683105 microseconds<br />
Output for 5.5.35, 5.6.17
Func took 1.6980171203613 microseconds<br />
Output for 5.6.16
Func took 1.8389225006104 microseconds<br />
Output for 5.6.15
Func took 1.6231536865234 microseconds<br />
Output for 5.6.14
Func took 1.7499923706055 microseconds<br />
Output for 5.6.13
Func took 1.9009113311768 microseconds<br />
Output for 5.3.10, 5.6.12
Func took 1.6560554504395 microseconds<br />
Output for 5.6.11
Func took 1.6450881958008 microseconds<br />
Output for 5.6.10
Func took 1.7409324645996 microseconds<br />
Output for 5.6.9
Func took 1.64794921875 microseconds<br />
Output for 5.6.8
Func took 1.6169548034668 microseconds<br />
Output for 5.6.7
Func took 1.9547939300537 microseconds<br />
Output for 5.6.6
Func took 2.1491050720215 microseconds<br />
Output for 5.6.5
Func took 1.9259452819824 microseconds<br />
Output for 5.6.4
Func took 1.6388893127441 microseconds<br />
Output for 5.6.3
Func took 2.2358894348145 microseconds<br />
Output for 5.6.2
Func took 1.6319751739502 microseconds<br />
Output for 5.6.1
Func took 2.3539066314697 microseconds<br />
Output for 5.6.0
Func took 1.9280910491943 microseconds<br />
Output for 5.5.38
Func took 2.1660327911377 microseconds<br />
Output for 5.5.37
Func took 1.6999244689941 microseconds<br />
Output for 5.5.36
Func took 1.9419193267822 microseconds<br />
Output for 5.5.34
Func took 1.9869804382324 microseconds<br />
Output for 5.5.33
Func took 3.7569999694824 microseconds<br />
Output for 5.5.32
Func took 1.6539096832275 microseconds<br />
Output for 5.5.31
Func took 2.5260448455811 microseconds<br />
Output for 5.5.30
Func took 1.9171237945557 microseconds<br />
Output for 5.5.29
Func took 1.9960403442383 microseconds<br />
Output for 5.5.28
Func took 2.7210712432861 microseconds<br />
Output for 5.5.27
Func took 1.8959045410156 microseconds<br />
Output for 5.5.26
Func took 3.4859180450439 microseconds<br />
Output for 5.5.25
Func took 1.8751621246338 microseconds<br />
Output for 5.5.24
Func took 3.1030178070068 microseconds<br />
Output for 5.5.23
Func took 3.9489269256592 microseconds<br />
Output for 5.5.22
Func took 2.4929046630859 microseconds<br />
Output for 5.5.21
Func took 2.4700164794922 microseconds<br />
Output for 5.5.20
Func took 2.7530193328857 microseconds<br />
Output for 5.5.19
Func took 3.3690929412842 microseconds<br />
Output for 5.3.29, 5.5.18
Func took 1.6310214996338 microseconds<br />
Output for 5.5.17
Func took 2.8259754180908 microseconds<br />
Output for 5.5.16
Func took 1.8579959869385 microseconds<br />
Output for 5.5.15
Func took 2.2530555725098 microseconds<br />
Output for 5.5.14
Func took 3.1259059906006 microseconds<br />
Output for 5.5.13
Func took 2.4781227111816 microseconds<br />
Output for 5.5.12
Func took 2.8340816497803 microseconds<br />
Output for 5.5.11
Func took 3.267765045166 microseconds<br />
Output for 5.5.10
Func took 2.4008750915527 microseconds<br />
Output for 5.5.9
Func took 2.6481151580811 microseconds<br />
Output for 5.5.8
Func took 2.6829242706299 microseconds<br />
Output for 5.5.7
Func took 2.9559135437012 microseconds<br />
Output for 5.5.6
Func took 3.2930374145508 microseconds<br />
Output for 5.5.5
Func took 2.579927444458 microseconds<br />
Output for 5.5.4
Func took 2.1638870239258 microseconds<br />
Output for 5.5.3
Func took 2.4898052215576 microseconds<br />
Output for 5.5.2
Func took 3.4220218658447 microseconds<br />
Output for 5.5.1
Func took 2.6700496673584 microseconds<br />
Output for 5.5.0
Func took 2.6199817657471 microseconds<br />
Output for 5.4.45
Func took 2.9630661010742 microseconds<br />
Output for 5.4.44
Func took 2.3298263549805 microseconds<br />
Output for 5.4.43
Func took 2.9361248016357 microseconds<br />
Output for 5.4.42
Func took 2.514123916626 microseconds<br />
Output for 5.4.41
Func took 2.9640197753906 microseconds<br />
Output for 5.4.40
Func took 1.9090175628662 microseconds<br />
Output for 5.4.39
Func took 1.9080638885498 microseconds<br />
Output for 5.4.38
Func took 3.3318996429443 microseconds<br />
Output for 5.4.37
Func took 1.9900798797607 microseconds<br />
Output for 5.4.36
Func took 3.3261775970459 microseconds<br />
Output for 5.4.27, 5.4.35
Func took 2.8138160705566 microseconds<br />
Output for 5.3.28, 5.4.34
Func took 1.6469955444336 microseconds<br />
Output for 5.4.33
Func took 2.086877822876 microseconds<br />
Output for 5.4.32
Func took 3.0598640441895 microseconds<br />
Output for 5.4.31
Func took 3.4899711608887 microseconds<br />
Output for 5.4.30
Func took 1.7039775848389 microseconds<br />
Output for 5.4.29
Func took 3.1321048736572 microseconds<br />
Output for 5.4.28
Func took 3.054141998291 microseconds<br />
Output for 5.4.26
Func took 1.9340515136719 microseconds<br />
Output for 5.4.25
Func took 2.3019313812256 microseconds<br />
Output for 5.4.24
Func took 2.2690296173096 microseconds<br />
Output for 5.4.23
Func took 2.5529861450195 microseconds<br />
Output for 5.4.22
Func took 2.0740032196045 microseconds<br />
Output for 5.4.21
Func took 2.9029846191406 microseconds<br />
Output for 5.4.20
Func took 2.5379657745361 microseconds<br />
Output for 5.4.19
Func took 2.5081634521484 microseconds<br />
Output for 5.4.18
Func took 1.784086227417 microseconds<br />
Output for 5.4.17
Func took 3.5090446472168 microseconds<br />
Output for 5.4.16
Func took 2.0339488983154 microseconds<br />
Output for 5.4.15
Func took 1.6918182373047 microseconds<br />
Output for 5.4.14
Func took 1.8260478973389 microseconds<br />
Output for 5.4.13
Func took 1.8200874328613 microseconds<br />
Output for 5.4.12
Func took 2.5131702423096 microseconds<br />
Output for 5.4.11
Func took 2.3069381713867 microseconds<br />
Output for 5.4.10
Func took 3.2122135162354 microseconds<br />
Output for 5.4.9
Func took 2.985954284668 microseconds<br />
Output for 5.4.8
Func took 2.8212070465088 microseconds<br />
Output for 5.4.7
Func took 2.7480125427246 microseconds<br />
Output for 5.4.6
Func took 2.6841163635254 microseconds<br />
Output for 5.4.5
Func took 1.7411708831787 microseconds<br />
Output for 5.4.4
Func took 27.077913284302 microseconds<br />
Output for 5.4.3
Func took 1.7821788787842 microseconds<br />
Output for 5.4.2
Func took 2.0279884338379 microseconds<br />
Output for 5.4.1
Func took 1.77001953125 microseconds<br />
Output for 5.4.0
Func took 2.810001373291 microseconds<br />
Output for 5.3.27
Func took 1.9190311431885 microseconds<br />
Output for 5.3.26
Func took 1.6732215881348 microseconds<br />
Output for 5.3.25
Func took 2.9830932617188 microseconds<br />
Output for 5.3.11, 5.3.24
Func took 1.7151832580566 microseconds<br />
Output for 5.3.23
Func took 1.6942024230957 microseconds<br />
Output for 5.3.22
Func took 1.7402172088623 microseconds<br />
Output for 5.3.21
Func took 1.7139911651611 microseconds<br />
Output for 5.3.20
Func took 2.453088760376 microseconds<br />
Output for 5.3.19
Func took 2.3870468139648 microseconds<br />
Output for 5.3.18
Func took 1.7521381378174 microseconds<br />
Output for 5.3.17
Func took 1.9741058349609 microseconds<br />
Output for 5.3.16
Func took 1.6741752624512 microseconds<br />
Output for 5.3.15
Func took 1.7271041870117 microseconds<br />
Output for 5.3.14
Func took 2.1610260009766 microseconds<br />
Output for 5.3.13
Func took 1.7530918121338 microseconds<br />
Output for 5.3.12
Func took 1.6970634460449 microseconds<br />
Output for 5.3.9
Func took 1.9659996032715 microseconds<br />
Output for 5.3.8
Func took 1.7240047454834 microseconds<br />
Output for 5.3.7
Func took 1.845121383667 microseconds<br />
Output for 5.3.6
Func took 2.0031929016113 microseconds<br />
Output for 5.3.5
Func took 2.5510787963867 microseconds<br />
Output for 5.3.4
Func took 1.7740726470947 microseconds<br />
Output for 5.3.3
Func took 2.2420883178711 microseconds<br />
Output for 5.3.2
Func took 2.3560523986816 microseconds<br />
Output for 5.3.1
Func took 1.8291473388672 microseconds<br />
Output for 5.3.0
Func took 1.8351078033447 microseconds<br />
Output for 5.1.0 - 5.1.6, 5.2.0 - 5.2.17
Parse error: syntax error, unexpected T_STATIC in /in/obodC 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/obodC 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/obodC on line 13
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.3.11, 4.4.0 - 4.4.1
Parse error: parse error, unexpected T_CLASS in /in/obodC on line 13
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/obodC on line 13
Process exited with code 255.

preferences:
263.54 ms | 401 KiB | 325 Q