3v4l.org

run code in 300+ PHP versions simultaneously
<?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.2.11
Func took 1.3391971588135 microseconds<br />
Output for 7.2.10
Func took 1.600980758667 microseconds<br />
Output for 7.2.9
Func took 1.6040802001953 microseconds<br />
Output for 7.2.8
Func took 1.2969970703125 microseconds<br />
Output for 7.2.7
Func took 1.2710094451904 microseconds<br />
Output for 7.2.6
Func took 1.244068145752 microseconds<br />
Output for 7.2.5
Func took 1.5158653259277 microseconds<br />
Output for 7.2.4
Func took 1.3389587402344 microseconds<br />
Output for 7.2.3
Func took 1.2500286102295 microseconds<br />
Output for 7.2.2
Func took 1.3110637664795 microseconds<br />
Output for 7.2.1
Func took 1.8680095672607 microseconds<br />
Output for 7.0.25, 7.2.0
Func took 1.2400150299072 microseconds<br />
Output for 7.1.23
Func took 2.0148754119873 microseconds<br />
Output for 7.0.15, 7.1.22
Func took 1.3039112091064 microseconds<br />
Output for 7.1.21
Func took 1.2600421905518 microseconds<br />
Output for 7.0.11, 7.1.20
Func took 1.2519359588623 microseconds<br />
Output for 7.1.19
Func took 1.3442039489746 microseconds<br />
Output for 7.1.18
Func took 1.762866973877 microseconds<br />
Output for 7.1.17
Func took 1.2640953063965 microseconds<br />
Output for 7.1.16
Func took 1.2469291687012 microseconds<br />
Output for 7.1.15
Func took 1.5008449554443 microseconds<br />
Output for 7.1.14
Func took 1.1889934539795 microseconds<br />
Output for 7.1.13
Func took 1.7931461334229 microseconds<br />
Output for 7.1.12
Func took 1.2879371643066 microseconds<br />
Output for 7.1.11
Func took 1.3730525970459 microseconds<br />
Output for 7.1.10
Func took 1.5499591827393 microseconds<br />
Output for 7.1.9
Func took 1.2288093566895 microseconds<br />
Output for 7.1.8
Func took 1.176118850708 microseconds<br />
Output for 7.1.7
Func took 1.8150806427002 microseconds<br />
Output for 7.1.6
Func took 1.1968612670898 microseconds<br />
Output for 7.1.5
Func took 1.2757778167725 microseconds<br />
Output for 7.1.4
Func took 1.2919902801514 microseconds<br />
Output for 7.1.3
Func took 1.3830661773682 microseconds<br />
Output for 7.1.2
Func took 1.6548633575439 microseconds<br />
Output for 7.1.1
Func took 1.7790794372559 microseconds<br />
Output for 7.1.0
Func took 1.8191337585449 microseconds<br />
Output for 7.0.31
Func took 1.2290477752686 microseconds<br />
Output for 7.0.30
Func took 1.5010833740234 microseconds<br />
Output for 7.0.29
Func took 1.4450550079346 microseconds<br />
Output for 7.0.28
Func took 1.2378692626953 microseconds<br />
Output for 7.0.27
Func took 1.2028217315674 microseconds<br />
Output for 7.0.26
Func took 1.1970996856689 microseconds<br />
Output for 7.0.24
Func took 1.1959075927734 microseconds<br />
Output for 7.0.23
Func took 1.4560222625732 microseconds<br />
Output for 7.0.22
Func took 1.7859935760498 microseconds<br />
Output for 7.0.21
Func took 1.2338161468506 microseconds<br />
Output for 7.0.20
Func took 1.3589859008789 microseconds<br />
Output for 7.0.19
Func took 1.3399124145508 microseconds<br />
Output for 7.0.18
Func took 1.7478466033936 microseconds<br />
Output for 7.0.17
Func took 1.6429424285889 microseconds<br />
Output for 7.0.16
Func took 1.2907981872559 microseconds<br />
Output for 7.0.14
Func took 1.6379356384277 microseconds<br />
Output for 7.0.13
Func took 2.3410320281982 microseconds<br />
Output for 7.0.12
Func took 1.5239715576172 microseconds<br />
Output for 7.0.10
Func took 1.255989074707 microseconds<br />
Output for 7.0.9
Func took 1.2118816375732 microseconds<br />
Output for 7.0.8
Func took 1.6598701477051 microseconds<br />
Output for 7.0.7
Func took 1.5170574188232 microseconds<br />
Output for 7.0.6
Func took 1.6908645629883 microseconds<br />
Output for 7.0.5
Func took 1.3301372528076 microseconds<br />
Output for 7.0.4
Func took 1.492977142334 microseconds<br />
Output for 7.0.3
Func took 1.4688968658447 microseconds<br />
Output for 7.0.2
Func took 2.2401809692383 microseconds<br />
Output for 7.0.1
Func took 1.6129016876221 microseconds<br />
Output for 7.0.0
Func took 1.3909339904785 microseconds<br />
Output for 5.6.38
Func took 7.0450305938721 microseconds<br />
Output for 5.6.37
Func took 6.7658424377441 microseconds<br />
Output for 5.6.36
Func took 6.8089962005615 microseconds<br />
Output for 5.6.35
Func took 6.7169666290283 microseconds<br />
Output for 5.6.34
Func took 6.6769123077393 microseconds<br />
Output for 5.6.33
Func took 6.9279670715332 microseconds<br />
Output for 5.6.32
Func took 7.3981285095215 microseconds<br />
Output for 5.6.31
Func took 6.8211555480957 microseconds<br />
Output for 5.6.30
Func took 7.3370933532715 microseconds<br />
Output for 5.6.29
Func took 6.8070888519287 microseconds<br />
Output for 5.6.28
Func took 6.9069862365723 microseconds<br />
Output for 5.6.27
Func took 6.8838596343994 microseconds<br />
Output for 5.6.26
Func took 6.8950653076172 microseconds<br />
Output for 5.6.25
Func took 6.8390369415283 microseconds<br />
Output for 5.6.24
Func took 6.6561698913574 microseconds<br />
Output for 5.6.23
Func took 6.8628787994385 microseconds<br />
Output for 5.6.22
Func took 6.9191455841064 microseconds<br />
Output for 5.6.21
Func took 7.6389312744141 microseconds<br />
Output for 5.6.20
Func took 7.7929496765137 microseconds<br />
Output for 5.6.19
Func took 6.8440437316895 microseconds<br />
Output for 5.6.18
Func took 11.414051055908 microseconds<br />
Output for 5.6.17
Func took 7.1320533752441 microseconds<br />
Output for 5.6.16
Func took 6.9499015808105 microseconds<br />
Output for 5.6.15
Func took 7.335901260376 microseconds<br />
Output for 5.6.14
Func took 7.1330070495605 microseconds<br />
Output for 5.6.13
Func took 7.1561336517334 microseconds<br />
Output for 5.6.12
Func took 7.1489810943604 microseconds<br />
Output for 5.6.11
Func took 7.2548389434814 microseconds<br />
Output for 5.6.10
Func took 8.1939697265625 microseconds<br />
Output for 5.6.9
Func took 7.2078704833984 microseconds<br />
Output for 5.5.38, 5.6.8
Func took 7.0171356201172 microseconds<br />
Output for 5.6.7
Func took 7.0109367370605 microseconds<br />
Output for 5.6.6
Func took 7.7221393585205 microseconds<br />
Output for 5.6.5
Func took 8.2991123199463 microseconds<br />
Output for 5.6.4
Func took 6.7989826202393 microseconds<br />
Output for 5.6.3
Func took 7.0490837097168 microseconds<br />
Output for 5.6.2
Func took 7.2090625762939 microseconds<br />
Output for 5.6.1
Func took 8.6660385131836 microseconds<br />
Output for 5.6.0
Func took 9.0088844299316 microseconds<br />
Output for 5.5.37
Func took 6.8590641021729 microseconds<br />
Output for 5.5.36
Func took 7.0400238037109 microseconds<br />
Output for 5.5.35
Func took 7.580041885376 microseconds<br />
Output for 5.5.34
Func took 7.0340633392334 microseconds<br />
Output for 5.5.33
Func took 8.38303565979 microseconds<br />
Output for 5.5.32
Func took 7.6680183410645 microseconds<br />
Output for 5.5.31
Func took 7.2720050811768 microseconds<br />
Output for 5.5.30
Func took 7.1218013763428 microseconds<br />
Output for 5.5.29
Func took 7.2290897369385 microseconds<br />
Output for 5.5.28
Func took 7.1370601654053 microseconds<br />
Output for 5.5.27
Func took 7.0350170135498 microseconds<br />
Output for 5.5.26
Func took 7.1818828582764 microseconds<br />
Output for 5.5.25
Func took 7.2500705718994 microseconds<br />
Output for 5.5.24
Func took 7.4131488800049 microseconds<br />
Output for 5.5.23
Func took 7.0910453796387 microseconds<br />
Output for 5.5.22
Func took 6.9808959960938 microseconds<br />
Output for 5.5.21
Func took 8.2800388336182 microseconds<br />
Output for 5.5.20
Func took 7.6210498809814 microseconds<br />
Output for 5.5.19
Func took 7.4918270111084 microseconds<br />
Output for 5.5.18
Func took 7.4899196624756 microseconds<br />
Output for 5.5.17
Func took 6.9708824157715 microseconds<br />
Output for 5.5.16
Func took 7.1558952331543 microseconds<br />
Output for 5.5.15
Func took 7.821798324585 microseconds<br />
Output for 5.5.14
Func took 7.0641040802002 microseconds<br />
Output for 5.5.13
Func took 11.757135391235 microseconds<br />
Output for 5.5.12
Func took 10.167837142944 microseconds<br />
Output for 5.5.11
Func took 6.7667961120605 microseconds<br />
Output for 5.5.10
Func took 7.1499347686768 microseconds<br />
Output for 5.5.9
Func took 7.6930522918701 microseconds<br />
Output for 5.5.8
Func took 7.1229934692383 microseconds<br />
Output for 5.5.7
Func took 7.066011428833 microseconds<br />
Output for 5.5.6
Func took 7.504940032959 microseconds<br />
Output for 5.5.5
Func took 7.2450637817383 microseconds<br />
Output for 5.5.4
Func took 7.4470043182373 microseconds<br />
Output for 5.5.3
Func took 7.3440074920654 microseconds<br />
Output for 5.5.2
Func took 6.8819522857666 microseconds<br />
Output for 5.5.1
Func took 7.2150230407715 microseconds<br />
Output for 5.5.0
Func took 7.1258544921875 microseconds<br />
Output for 5.4.45
Func took 7.235050201416 microseconds<br />
Output for 5.4.44
Func took 7.6479911804199 microseconds<br />
Output for 5.4.43
Func took 7.8439712524414 microseconds<br />
Output for 5.4.42
Func took 8.0151557922363 microseconds<br />
Output for 5.3.18, 5.4.41
Func took 7.1098804473877 microseconds<br />
Output for 5.4.40
Func took 7.3549747467041 microseconds<br />
Output for 5.4.39
Func took 7.8961849212646 microseconds<br />
Output for 5.4.38
Func took 6.8361759185791 microseconds<br />
Output for 5.4.37
Func took 7.9951286315918 microseconds<br />
Output for 5.4.36
Func took 7.5662136077881 microseconds<br />
Output for 5.4.35
Func took 7.1280002593994 microseconds<br />
Output for 5.4.34
Func took 6.8490505218506 microseconds<br />
Output for 5.4.33
Func took 7.5178146362305 microseconds<br />
Output for 5.4.32
Func took 7.4779987335205 microseconds<br />
Output for 5.4.31
Func took 7.7841281890869 microseconds<br />
Output for 5.4.30
Func took 7.5218677520752 microseconds<br />
Output for 5.4.29
Func took 9.0770721435547 microseconds<br />
Output for 5.4.28
Func took 7.2979927062988 microseconds<br />
Output for 5.4.27
Func took 7.8470706939697 microseconds<br />
Output for 5.4.26
Func took 7.5290203094482 microseconds<br />
Output for 5.4.25
Func took 7.7881813049316 microseconds<br />
Output for 5.4.24
Func took 7.1630477905273 microseconds<br />
Output for 5.4.23
Func took 7.5469017028809 microseconds<br />
Output for 5.4.22
Func took 8.012056350708 microseconds<br />
Output for 5.4.21
Func took 7.936954498291 microseconds<br />
Output for 5.4.20
Func took 7.5969696044922 microseconds<br />
Output for 5.4.19
Func took 7.9522132873535 microseconds<br />
Output for 5.4.18
Func took 6.7839622497559 microseconds<br />
Output for 5.4.17
Func took 6.9301128387451 microseconds<br />
Output for 5.4.16
Func took 7.2040557861328 microseconds<br />
Output for 5.4.15
Func took 7.4360370635986 microseconds<br />
Output for 5.4.14
Func took 7.4079036712646 microseconds<br />
Output for 5.4.13
Func took 7.1029663085938 microseconds<br />
Output for 5.4.12
Func took 7.2050094604492 microseconds<br />
Output for 5.4.11
Func took 7.5700283050537 microseconds<br />
Output for 5.4.10
Func took 7.4930191040039 microseconds<br />
Output for 5.4.9
Func took 6.8478584289551 microseconds<br />
Output for 5.4.8
Func took 7.7481269836426 microseconds<br />
Output for 5.4.7
Func took 6.9611072540283 microseconds<br />
Output for 5.4.6
Func took 7.5631141662598 microseconds<br />
Output for 5.4.5
Func took 7.3819160461426 microseconds<br />
Output for 5.4.4
Func took 10.93316078186 microseconds<br />
Output for 5.4.3
Func took 8.3990097045898 microseconds<br />
Output for 5.4.2
Func took 7.3659420013428 microseconds<br />
Output for 5.4.1
Func took 8.2910060882568 microseconds<br />
Output for 5.4.0
Func took 8.3470344543457 microseconds<br />
Output for 5.3.29
Func took 7.3778629302979 microseconds<br />
Output for 5.3.28
Func took 7.4660778045654 microseconds<br />
Output for 5.3.27
Func took 7.4050426483154 microseconds<br />
Output for 5.3.26
Func took 7.9178810119629 microseconds<br />
Output for 5.3.25
Func took 8.1779956817627 microseconds<br />
Output for 5.3.24
Func took 7.314920425415 microseconds<br />
Output for 5.3.23
Func took 7.5080394744873 microseconds<br />
Output for 5.3.22
Func took 7.4038505554199 microseconds<br />
Output for 5.3.21
Func took 7.4269771575928 microseconds<br />
Output for 5.3.20
Func took 7.3480606079102 microseconds<br />
Output for 5.3.19
Func took 7.7059268951416 microseconds<br />
Output for 5.3.17
Func took 7.2360038757324 microseconds<br />
Output for 5.3.16
Func took 8.404016494751 microseconds<br />
Output for 5.3.15
Func took 7.7300071716309 microseconds<br />
Output for 5.3.14
Func took 7.6758861541748 microseconds<br />
Output for 5.3.13
Func took 7.411003112793 microseconds<br />
Output for 5.3.12
Func took 8.5380077362061 microseconds<br />
Output for 5.3.11
Func took 8.2170963287354 microseconds<br />
Output for 5.3.10
Func took 8.1989765167236 microseconds<br />
Output for 5.3.9
Func took 8.8748931884766 microseconds<br />
Output for 5.3.8
Func took 8.4328651428223 microseconds<br />
Output for 5.3.7
Func took 9.753942489624 microseconds<br />
Output for 5.3.6
Func took 7.8999996185303 microseconds<br />
Output for 5.3.5
Func took 7.7838897705078 microseconds<br />
Output for 5.3.4
Func took 8.0358982086182 microseconds<br />
Output for 5.3.3
Func took 7.8051090240479 microseconds<br />
Output for 5.3.2
Func took 7.5149536132812 microseconds<br />
Output for 5.3.1
Func took 7.8980922698975 microseconds<br />
Output for 5.3.0
Func took 7.7989101409912 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/GXgQb 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/GXgQb 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/GXgQb 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/GXgQb on line 13
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/GXgQb on line 13
Process exited with code 255.

preferences:
216.05 ms | 401 KiB | 280 Q