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.4.1
Func took 1.0221004486084 microseconds<br />
Output for 7.4.0
Func took 0.99587440490723 microseconds<br />
Output for 7.3.13
Func took 0.885009765625 microseconds<br />
Output for 7.3.12
Func took 1.1069774627686 microseconds<br />
Output for 7.3.11
Func took 1.0089874267578 microseconds<br />
Output for 7.3.10
Func took 0.83589553833008 microseconds<br />
Output for 7.3.9
Func took 0.96702575683594 microseconds<br />
Output for 7.3.8
Func took 0.73790550231934 microseconds<br />
Output for 7.1.22, 7.3.7
Func took 1.039981842041 microseconds<br />
Output for 7.3.6
Func took 0.74601173400879 microseconds<br />
Output for 7.3.5
Func took 0.68497657775879 microseconds<br />
Output for 7.3.4
Func took 1.223087310791 microseconds<br />
Output for 7.2.15, 7.3.3
Func took 0.73599815368652 microseconds<br />
Output for 7.3.2
Func took 0.62394142150879 microseconds<br />
Output for 7.3.1
Func took 0.70381164550781 microseconds<br />
Output for 7.2.21, 7.3.0
Func took 0.68187713623047 microseconds<br />
Output for 7.2.26
Func took 0.946044921875 microseconds<br />
Output for 7.2.25
Func took 1.0061264038086 microseconds<br />
Output for 7.2.24
Func took 0.92196464538574 microseconds<br />
Output for 7.2.23
Func took 0.71310997009277 microseconds<br />
Output for 7.2.22
Func took 0.8699893951416 microseconds<br />
Output for 7.2.20
Func took 0.88787078857422 microseconds<br />
Output for 7.2.19
Func took 0.79584121704102 microseconds<br />
Output for 7.2.18
Func took 0.78916549682617 microseconds<br />
Output for 7.2.17
Func took 0.86808204650879 microseconds<br />
Output for 7.2.16
Func took 0.70309638977051 microseconds<br />
Output for 7.1.25, 7.2.14
Func took 0.73099136352539 microseconds<br />
Output for 7.0.5, 7.2.13
Func took 0.77104568481445 microseconds<br />
Output for 7.2.12
Func took 0.66709518432617 microseconds<br />
Output for 7.1.29, 7.2.11
Func took 1.0559558868408 microseconds<br />
Output for 7.2.10
Func took 0.81992149353027 microseconds<br />
Output for 7.2.9
Func took 0.61392784118652 microseconds<br />
Output for 7.2.7 - 7.2.8
Func took 0.65803527832031 microseconds<br />
Output for 7.2.6
Func took 0.80013275146484 microseconds<br />
Output for 7.2.5
Func took 0.65898895263672 microseconds<br />
Output for 7.2.4
Func took 0.70405006408691 microseconds<br />
Output for 7.2.3
Func took 0.71120262145996 microseconds<br />
Output for 7.2.2
Func took 0.69308280944824 microseconds<br />
Output for 7.2.1
Func took 0.67806243896484 microseconds<br />
Output for 7.2.0
Func took 0.78487396240234 microseconds<br />
Output for 7.1.33
Func took 0.80513954162598 microseconds<br />
Output for 7.1.32
Func took 1.2309551239014 microseconds<br />
Output for 7.1.31
Func took 0.8540153503418 microseconds<br />
Output for 7.1.30
Func took 1.3818740844727 microseconds<br />
Output for 7.1.28
Func took 1.1229515075684 microseconds<br />
Output for 7.1.27
Func took 0.89383125305176 microseconds<br />
Output for 7.1.26
Func took 0.99492073059082 microseconds<br />
Output for 7.1.24
Func took 0.77509880065918 microseconds<br />
Output for 7.0.22, 7.1.2, 7.1.23
Func took 0.86402893066406 microseconds<br />
Output for 7.1.21
Func took 0.80585479736328 microseconds<br />
Output for 7.1.20
Func took 0.80204010009766 microseconds<br />
Output for 7.1.16, 7.1.19
Func took 0.79989433288574 microseconds<br />
Output for 7.1.18
Func took 0.85091590881348 microseconds<br />
Output for 7.1.17
Func took 1.0161399841309 microseconds<br />
Output for 7.1.15
Func took 0.79798698425293 microseconds<br />
Output for 7.1.14
Func took 0.84304809570312 microseconds<br />
Output for 7.1.13
Func took 0.81515312194824 microseconds<br />
Output for 7.1.12
Func took 0.99611282348633 microseconds<br />
Output for 7.1.11
Func took 0.81610679626465 microseconds<br />
Output for 7.1.10
Func took 0.80418586730957 microseconds<br />
Output for 7.1.9
Func took 0.82206726074219 microseconds<br />
Output for 7.1.8
Func took 0.85186958312988 microseconds<br />
Output for 7.1.7
Func took 0.9760856628418 microseconds<br />
Output for 7.1.6
Func took 1.060962677002 microseconds<br />
Output for 7.1.5
Func took 1.3489723205566 microseconds<br />
Output for 7.1.4
Func took 0.92720985412598 microseconds<br />
Output for 7.1.3
Func took 1.0690689086914 microseconds<br />
Output for 7.1.1
Func took 0.80609321594238 microseconds<br />
Output for 7.1.0
Func took 0.77915191650391 microseconds<br />
Output for 7.0.33
Func took 0.84114074707031 microseconds<br />
Output for 7.0.26, 7.0.32
Func took 0.84686279296875 microseconds<br />
Output for 7.0.14, 7.0.31
Func took 0.75197219848633 microseconds<br />
Output for 7.0.30
Func took 0.92601776123047 microseconds<br />
Output for 7.0.29
Func took 0.762939453125 microseconds<br />
Output for 7.0.28
Func took 0.79607963562012 microseconds<br />
Output for 7.0.27
Func took 0.76198577880859 microseconds<br />
Output for 7.0.25
Func took 0.98896026611328 microseconds<br />
Output for 7.0.24
Func took 0.84185600280762 microseconds<br />
Output for 7.0.23
Func took 0.91719627380371 microseconds<br />
Output for 7.0.21
Func took 0.92911720275879 microseconds<br />
Output for 7.0.20
Func took 0.98800659179688 microseconds<br />
Output for 7.0.19
Func took 0.85806846618652 microseconds<br />
Output for 7.0.18
Func took 0.91910362243652 microseconds<br />
Output for 7.0.17
Func took 0.81896781921387 microseconds<br />
Output for 7.0.16
Func took 0.82802772521973 microseconds<br />
Output for 7.0.15
Func took 0.88691711425781 microseconds<br />
Output for 7.0.13
Func took 0.90408325195312 microseconds<br />
Output for 7.0.12
Func took 1.0020732879639 microseconds<br />
Output for 7.0.11
Func took 0.82492828369141 microseconds<br />
Output for 7.0.10
Func took 1.1579990386963 microseconds<br />
Output for 7.0.9
Func took 0.79011917114258 microseconds<br />
Output for 7.0.8
Func took 0.90789794921875 microseconds<br />
Output for 7.0.7
Func took 1.0249614715576 microseconds<br />
Output for 7.0.6
Func took 1.1329650878906 microseconds<br />
Output for 7.0.4
Func took 1.1448860168457 microseconds<br />
Output for 7.0.3
Func took 0.80490112304688 microseconds<br />
Output for 7.0.2
Func took 0.81491470336914 microseconds<br />
Output for 7.0.1
Func took 0.88405609130859 microseconds<br />
Output for 7.0.0
Func took 0.90479850769043 microseconds<br />
Output for 5.6.40
Func took 2.406120300293 microseconds<br />
Output for 5.6.39
Func took 2.2850036621094 microseconds<br />
Output for 5.6.38
Func took 3.004789352417 microseconds<br />
Output for 5.6.37
Func took 2.3279190063477 microseconds<br />
Output for 5.6.36
Func took 2.3808479309082 microseconds<br />
Output for 5.6.35
Func took 2.3930072784424 microseconds<br />
Output for 5.6.34
Func took 2.6609897613525 microseconds<br />
Output for 5.6.33
Func took 2.4409294128418 microseconds<br />
Output for 5.6.32
Func took 2.8820037841797 microseconds<br />
Output for 5.6.31
Func took 2.5160312652588 microseconds<br />
Output for 5.6.30
Func took 2.9170513153076 microseconds<br />
Output for 5.6.29
Func took 3.352165222168 microseconds<br />
Output for 5.6.28
Func took 2.4838447570801 microseconds<br />
Output for 5.6.27
Func took 2.3400783538818 microseconds<br />
Output for 5.6.26
Func took 2.6130676269531 microseconds<br />
Output for 5.6.25
Func took 2.6280879974365 microseconds<br />
Output for 5.6.24
Func took 2.3109912872314 microseconds<br />
Output for 5.6.23
Func took 2.3291110992432 microseconds<br />
Output for 5.6.22
Func took 3.1919479370117 microseconds<br />
Output for 5.6.21
Func took 2.6140213012695 microseconds<br />
Output for 5.6.20
Func took 2.5320053100586 microseconds<br />
Output for 5.6.19
Func took 2.3918151855469 microseconds<br />
Output for 5.6.18
Func took 3.2169818878174 microseconds<br />
Output for 5.6.17
Func took 2.3131370544434 microseconds<br />
Output for 5.5.2, 5.6.16
Func took 2.3760795593262 microseconds<br />
Output for 5.3.4, 5.6.15
Func took 2.3491382598877 microseconds<br />
Output for 5.6.14
Func took 2.3767948150635 microseconds<br />
Output for 5.6.13
Func took 2.331018447876 microseconds<br />
Output for 5.6.12
Func took 3.0529499053955 microseconds<br />
Output for 5.6.11
Func took 2.453088760376 microseconds<br />
Output for 5.6.10
Func took 2.4471282958984 microseconds<br />
Output for 5.6.9
Func took 2.7801990509033 microseconds<br />
Output for 5.6.8
Func took 2.7570724487305 microseconds<br />
Output for 5.6.7
Func took 2.2649765014648 microseconds<br />
Output for 5.6.6
Func took 2.7410984039307 microseconds<br />
Output for 5.6.5
Func took 2.4731159210205 microseconds<br />
Output for 5.6.4
Func took 2.3150444030762 microseconds<br />
Output for 5.6.3
Func took 2.3617744445801 microseconds<br />
Output for 5.6.2
Func took 3.4630298614502 microseconds<br />
Output for 5.6.1
Func took 3.4608840942383 microseconds<br />
Output for 5.4.32, 5.6.0
Func took 2.4011135101318 microseconds<br />
Output for 5.5.38
Func took 3.3061504364014 microseconds<br />
Output for 5.5.37
Func took 2.3579597473145 microseconds<br />
Output for 5.5.36
Func took 2.5718212127686 microseconds<br />
Output for 5.5.35
Func took 2.816915512085 microseconds<br />
Output for 5.5.34
Func took 2.6319026947021 microseconds<br />
Output for 5.5.33
Func took 2.3288726806641 microseconds<br />
Output for 5.5.32
Func took 2.3720264434814 microseconds<br />
Output for 5.5.31
Func took 3.0968189239502 microseconds<br />
Output for 5.5.30
Func took 2.5022029876709 microseconds<br />
Output for 5.5.29
Func took 2.3319721221924 microseconds<br />
Output for 5.5.28
Func took 2.310037612915 microseconds<br />
Output for 5.5.27
Func took 2.4781227111816 microseconds<br />
Output for 5.5.14, 5.5.26
Func took 2.3419857025146 microseconds<br />
Output for 5.5.25
Func took 2.5858879089355 microseconds<br />
Output for 5.5.24
Func took 2.8190612792969 microseconds<br />
Output for 5.5.23
Func took 2.284049987793 microseconds<br />
Output for 5.5.22
Func took 3.5021305084229 microseconds<br />
Output for 5.5.21
Func took 3.4828186035156 microseconds<br />
Output for 5.5.20
Func took 3.0438899993896 microseconds<br />
Output for 5.5.19
Func took 4.4770240783691 microseconds<br />
Output for 5.5.18
Func took 3.3459663391113 microseconds<br />
Output for 5.5.17
Func took 3.4720897674561 microseconds<br />
Output for 5.5.16
Func took 3.493070602417 microseconds<br />
Output for 5.5.15
Func took 2.3539066314697 microseconds<br />
Output for 5.5.13
Func took 2.3300647735596 microseconds<br />
Output for 5.5.12
Func took 2.6187896728516 microseconds<br />
Output for 5.5.11
Func took 3.5741329193115 microseconds<br />
Output for 5.5.10
Func took 2.5899410247803 microseconds<br />
Output for 5.5.9
Func took 2.5649070739746 microseconds<br />
Output for 5.5.8
Func took 2.2599697113037 microseconds<br />
Output for 5.5.7
Func took 2.3519992828369 microseconds<br />
Output for 5.5.6
Func took 2.4161338806152 microseconds<br />
Output for 5.5.5
Func took 3.2029151916504 microseconds<br />
Output for 5.5.4
Func took 2.2611618041992 microseconds<br />
Output for 5.5.3
Func took 2.2320747375488 microseconds<br />
Output for 5.5.1
Func took 2.6869773864746 microseconds<br />
Output for 5.5.0
Func took 2.4998188018799 microseconds<br />
Output for 5.4.45
Func took 2.4230480194092 microseconds<br />
Output for 5.4.44
Func took 2.4368762969971 microseconds<br />
Output for 5.4.43
Func took 2.8369426727295 microseconds<br />
Output for 5.4.42
Func took 2.701997756958 microseconds<br />
Output for 5.4.41
Func took 3.3318996429443 microseconds<br />
Output for 5.4.40
Func took 2.4468898773193 microseconds<br />
Output for 5.4.39
Func took 2.7058124542236 microseconds<br />
Output for 5.4.38
Func took 3.6308765411377 microseconds<br />
Output for 5.4.37
Func took 2.4738311767578 microseconds<br />
Output for 5.4.36
Func took 3.4351348876953 microseconds<br />
Output for 5.4.35
Func took 2.4099349975586 microseconds<br />
Output for 5.4.34
Func took 3.4799575805664 microseconds<br />
Output for 5.4.33
Func took 30.044794082642 microseconds<br />
Output for 5.4.31
Func took 2.5148391723633 microseconds<br />
Output for 5.4.30
Func took 2.3238658905029 microseconds<br />
Output for 5.4.29
Func took 2.7930736541748 microseconds<br />
Output for 5.4.28
Func took 2.9551982879639 microseconds<br />
Output for 5.4.27
Func took 2.357006072998 microseconds<br />
Output for 5.4.26
Func took 2.3601055145264 microseconds<br />
Output for 5.4.25
Func took 2.720832824707 microseconds<br />
Output for 5.4.24
Func took 2.4621486663818 microseconds<br />
Output for 5.4.23
Func took 2.4690628051758 microseconds<br />
Output for 5.4.22
Func took 2.3198127746582 microseconds<br />
Output for 5.4.21
Func took 2.5241374969482 microseconds<br />
Output for 5.4.20
Func took 2.3009777069092 microseconds<br />
Output for 5.4.19
Func took 2.3949146270752 microseconds<br />
Output for 5.4.18
Func took 3.0820369720459 microseconds<br />
Output for 5.4.17
Func took 2.3069381713867 microseconds<br />
Output for 5.4.16
Func took 2.9981136322021 microseconds<br />
Output for 5.4.15
Func took 2.4189949035645 microseconds<br />
Output for 5.4.14
Func took 3.648042678833 microseconds<br />
Output for 5.4.13
Func took 2.4268627166748 microseconds<br />
Output for 5.4.12
Func took 2.4299621582031 microseconds<br />
Output for 5.4.11
Func took 28.352975845337 microseconds<br />
Output for 5.4.10
Func took 2.4361610412598 microseconds<br />
Output for 5.4.9
Func took 2.5210380554199 microseconds<br />
Output for 5.4.8
Func took 3.0710697174072 microseconds<br />
Output for 5.4.7
Func took 2.7010440826416 microseconds<br />
Output for 5.4.6
Func took 2.5169849395752 microseconds<br />
Output for 5.4.5
Func took 2.683162689209 microseconds<br />
Output for 5.4.4
Func took 3.0109882354736 microseconds<br />
Output for 5.4.3
Func took 2.8409957885742 microseconds<br />
Output for 5.4.2
Func took 2.5429725646973 microseconds<br />
Output for 5.4.1
Func took 20.060062408447 microseconds<br />
Output for 5.4.0
Func took 2.7139186859131 microseconds<br />
Output for 5.3.29
Func took 3.5982131958008 microseconds<br />
Output for 5.3.28
Func took 2.3641586303711 microseconds<br />
Output for 5.3.27
Func took 2.485990524292 microseconds<br />
Output for 5.3.26
Func took 2.4900436401367 microseconds<br />
Output for 5.3.25
Func took 2.4130344390869 microseconds<br />
Output for 5.3.24
Func took 3.0601024627686 microseconds<br />
Output for 5.3.23
Func took 3.2172203063965 microseconds<br />
Output for 5.3.22
Func took 3.6342144012451 microseconds<br />
Output for 5.3.17, 5.3.21
Func took 2.35915184021 microseconds<br />
Output for 5.3.20
Func took 3.6711692810059 microseconds<br />
Output for 5.3.19
Func took 4.033088684082 microseconds<br />
Output for 5.3.18
Func took 2.5560855865479 microseconds<br />
Output for 5.3.16
Func took 2.5460720062256 microseconds<br />
Output for 5.3.15
Func took 2.4981498718262 microseconds<br />
Output for 5.3.14
Func took 3.5750865936279 microseconds<br />
Output for 5.3.13
Func took 3.5240650177002 microseconds<br />
Output for 5.3.12
Func took 2.3891925811768 microseconds<br />
Output for 5.3.11
Func took 2.4101734161377 microseconds<br />
Output for 5.3.10
Func took 2.3581981658936 microseconds<br />
Output for 5.3.9
Func took 3.5951137542725 microseconds<br />
Output for 5.3.8
Func took 2.5341510772705 microseconds<br />
Output for 5.3.7
Func took 2.5110244750977 microseconds<br />
Output for 5.3.6
Func took 2.3510456085205 microseconds<br />
Output for 5.3.5
Func took 2.4991035461426 microseconds<br />
Output for 5.3.3
Func took 2.3560523986816 microseconds<br />
Output for 5.3.2
Func took 2.2730827331543 microseconds<br />
Output for 5.3.1
Func took 2.3190975189209 microseconds<br />
Output for 5.3.0
Func took 2.3350715637207 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/ubuVs 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/ubuVs 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/ubuVs 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/ubuVs on line 13
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/ubuVs on line 13
Process exited with code 255.

preferences:
228.36 ms | 401 KiB | 325 Q