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 (array_key_exists($key, $a)) { 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.0
Func took 2.8901100158691 microseconds<br />
Output for 7.3.12
Func took 3.4501552581787 microseconds<br />
Output for 7.0.12, 7.3.11
Func took 2.82883644104 microseconds<br />
Output for 7.3.10
Func took 3.0081272125244 microseconds<br />
Output for 7.3.9
Func took 2.3059844970703 microseconds<br />
Output for 7.3.8
Func took 2.3870468139648 microseconds<br />
Output for 7.3.7
Func took 2.3550987243652 microseconds<br />
Output for 7.3.6
Func took 2.3341178894043 microseconds<br />
Output for 7.3.5
Func took 2.734899520874 microseconds<br />
Output for 7.3.4
Func took 2.471923828125 microseconds<br />
Output for 7.3.3
Func took 2.1898746490479 microseconds<br />
Output for 7.3.2
Func took 1.6310214996338 microseconds<br />
Output for 7.3.1
Func took 1.6279220581055 microseconds<br />
Output for 7.3.0
Func took 1.7311573028564 microseconds<br />
Output for 7.2.25
Func took 3.6678314208984 microseconds<br />
Output for 7.2.24
Func took 3.6709308624268 microseconds<br />
Output for 7.2.23
Func took 2.392053604126 microseconds<br />
Output for 7.2.22
Func took 2.4111270904541 microseconds<br />
Output for 7.2.21
Func took 2.9227733612061 microseconds<br />
Output for 7.2.20
Func took 2.8200149536133 microseconds<br />
Output for 7.2.19
Func took 2.2890567779541 microseconds<br />
Output for 7.2.18
Func took 2.4888515472412 microseconds<br />
Output for 7.2.17
Func took 2.3078918457031 microseconds<br />
Output for 7.2.16
Func took 2.4070739746094 microseconds<br />
Output for 7.2.15
Func took 1.8100738525391 microseconds<br />
Output for 7.2.14
Func took 1.7929077148438 microseconds<br />
Output for 7.2.13
Func took 1.7971992492676 microseconds<br />
Output for 7.2.12
Func took 2.5138854980469 microseconds<br />
Output for 7.2.11
Func took 1.8491744995117 microseconds<br />
Output for 7.2.10
Func took 1.971960067749 microseconds<br />
Output for 7.2.9
Func took 1.9500255584717 microseconds<br />
Output for 7.2.8
Func took 1.7778873443604 microseconds<br />
Output for 7.2.7
Func took 1.9760131835938 microseconds<br />
Output for 7.2.6
Func took 1.7538070678711 microseconds<br />
Output for 7.2.5
Func took 1.7910003662109 microseconds<br />
Output for 7.2.4
Func took 2.5060176849365 microseconds<br />
Output for 7.2.3
Func took 2.1641254425049 microseconds<br />
Output for 7.2.2
Func took 1.8119812011719 microseconds<br />
Output for 7.2.1
Func took 1.9559860229492 microseconds<br />
Output for 7.2.0
Func took 1.8758773803711 microseconds<br />
Output for 7.1.33
Func took 3.5710334777832 microseconds<br />
Output for 7.1.32
Func took 3.0689239501953 microseconds<br />
Output for 7.1.31
Func took 2.6049613952637 microseconds<br />
Output for 7.1.30
Func took 3.5650730133057 microseconds<br />
Output for 7.1.29
Func took 2.932071685791 microseconds<br />
Output for 7.1.28
Func took 2.7840137481689 microseconds<br />
Output for 7.1.27
Func took 2.8231143951416 microseconds<br />
Output for 7.1.26
Func took 2.5460720062256 microseconds<br />
Output for 7.1.25
Func took 2.6130676269531 microseconds<br />
Output for 7.1.24
Func took 2.6609897613525 microseconds<br />
Output for 7.1.23
Func took 2.7439594268799 microseconds<br />
Output for 7.1.22
Func took 2.6531219482422 microseconds<br />
Output for 7.1.21
Func took 2.7449131011963 microseconds<br />
Output for 7.1.20
Func took 2.7060508728027 microseconds<br />
Output for 7.1.19
Func took 2.6428699493408 microseconds<br />
Output for 7.1.18
Func took 2.5660991668701 microseconds<br />
Output for 7.1.17
Func took 2.8600692749023 microseconds<br />
Output for 7.1.16
Func took 2.6161670684814 microseconds<br />
Output for 7.1.15
Func took 2.7480125427246 microseconds<br />
Output for 7.1.14
Func took 2.8939247131348 microseconds<br />
Output for 7.1.13
Func took 2.593994140625 microseconds<br />
Output for 7.1.12
Func took 2.6371479034424 microseconds<br />
Output for 7.1.11
Func took 2.6619434356689 microseconds<br />
Output for 7.1.10
Func took 2.5081634521484 microseconds<br />
Output for 7.1.9
Func took 2.5510787963867 microseconds<br />
Output for 7.0.23, 7.1.8
Func took 2.5839805603027 microseconds<br />
Output for 7.1.7
Func took 2.5889873504639 microseconds<br />
Output for 7.1.6
Func took 3.2858848571777 microseconds<br />
Output for 7.1.5
Func took 2.551794052124 microseconds<br />
Output for 7.1.4
Func took 2.7170181274414 microseconds<br />
Output for 7.1.3
Func took 2.6490688323975 microseconds<br />
Output for 7.1.2
Func took 2.7749538421631 microseconds<br />
Output for 7.1.1
Func took 2.7768611907959 microseconds<br />
Output for 7.1.0
Func took 3.0579566955566 microseconds<br />
Output for 7.0.33
Func took 2.8188228607178 microseconds<br />
Output for 7.0.32
Func took 3.2649040222168 microseconds<br />
Output for 7.0.31
Func took 3.2088756561279 microseconds<br />
Output for 7.0.30
Func took 2.5911331176758 microseconds<br />
Output for 7.0.29
Func took 2.6919841766357 microseconds<br />
Output for 7.0.28
Func took 3.5660266876221 microseconds<br />
Output for 7.0.27
Func took 2.5529861450195 microseconds<br />
Output for 7.0.26
Func took 2.6721954345703 microseconds<br />
Output for 7.0.25
Func took 2.9079914093018 microseconds<br />
Output for 7.0.24
Func took 3.1790733337402 microseconds<br />
Output for 7.0.22
Func took 2.5761127471924 microseconds<br />
Output for 7.0.21
Func took 2.5720596313477 microseconds<br />
Output for 7.0.20
Func took 2.6528835296631 microseconds<br />
Output for 7.0.19
Func took 2.5777816772461 microseconds<br />
Output for 7.0.18
Func took 2.8970241546631 microseconds<br />
Output for 7.0.17
Func took 3.0019283294678 microseconds<br />
Output for 7.0.16
Func took 3.0550956726074 microseconds<br />
Output for 7.0.15
Func took 3.1161308288574 microseconds<br />
Output for 7.0.14
Func took 3.5779476165771 microseconds<br />
Output for 7.0.13
Func took 2.7399063110352 microseconds<br />
Output for 7.0.11
Func took 3.0691623687744 microseconds<br />
Output for 7.0.10
Func took 3.593921661377 microseconds<br />
Output for 7.0.9
Func took 3.0078887939453 microseconds<br />
Output for 7.0.8
Func took 2.830982208252 microseconds<br />
Output for 7.0.7
Func took 2.8681755065918 microseconds<br />
Output for 7.0.6
Func took 2.9678344726562 microseconds<br />
Output for 7.0.5
Func took 3.31711769104 microseconds<br />
Output for 7.0.4
Func took 3.1251907348633 microseconds<br />
Output for 7.0.3
Func took 2.6857852935791 microseconds<br />
Output for 7.0.2
Func took 3.8478374481201 microseconds<br />
Output for 7.0.1
Func took 2.8071403503418 microseconds<br />
Output for 7.0.0
Func took 2.7861595153809 microseconds<br />
Output for 5.6.40
Func took 11.183977127075 microseconds<br />
Output for 5.6.39
Func took 10.949850082397 microseconds<br />
Output for 5.6.38
Func took 11.124849319458 microseconds<br />
Output for 5.6.37
Func took 10.951995849609 microseconds<br />
Output for 5.6.36
Func took 10.571002960205 microseconds<br />
Output for 5.6.35
Func took 11.385917663574 microseconds<br />
Output for 5.6.34
Func took 10.851860046387 microseconds<br />
Output for 5.6.33
Func took 11.358022689819 microseconds<br />
Output for 5.6.32
Func took 11.039018630981 microseconds<br />
Output for 5.6.31
Func took 10.763168334961 microseconds<br />
Output for 5.6.30
Func took 11.826038360596 microseconds<br />
Output for 5.6.29
Func took 12.556791305542 microseconds<br />
Output for 5.6.28
Func took 11.835098266602 microseconds<br />
Output for 5.6.27
Func took 11.876106262207 microseconds<br />
Output for 5.6.26
Func took 10.787010192871 microseconds<br />
Output for 5.6.25
Func took 13.413906097412 microseconds<br />
Output for 5.6.24
Func took 11.47198677063 microseconds<br />
Output for 5.6.23
Func took 12.444019317627 microseconds<br />
Output for 5.6.22
Func took 12.766122817993 microseconds<br />
Output for 5.6.21
Func took 15.423059463501 microseconds<br />
Output for 5.6.20
Func took 10.694026947021 microseconds<br />
Output for 5.6.19
Func took 11.173963546753 microseconds<br />
Output for 5.6.18
Func took 12.840986251831 microseconds<br />
Output for 5.6.17
Func took 11.135101318359 microseconds<br />
Output for 5.6.16
Func took 10.695934295654 microseconds<br />
Output for 5.6.15
Func took 11.31796836853 microseconds<br />
Output for 5.6.14
Func took 13.181924819946 microseconds<br />
Output for 5.6.13
Func took 10.860919952393 microseconds<br />
Output for 5.6.12
Func took 10.644912719727 microseconds<br />
Output for 5.6.11
Func took 10.847806930542 microseconds<br />
Output for 5.6.10
Func took 13.38791847229 microseconds<br />
Output for 5.6.9
Func took 17.314910888672 microseconds<br />
Output for 5.6.6, 5.6.8
Func took 10.869026184082 microseconds<br />
Output for 5.6.7
Func took 12.202024459839 microseconds<br />
Output for 5.5.3, 5.6.5
Func took 11.332988739014 microseconds<br />
Output for 5.6.4
Func took 10.915040969849 microseconds<br />
Output for 5.6.3
Func took 10.754108428955 microseconds<br />
Output for 5.6.2
Func took 13.353109359741 microseconds<br />
Output for 5.6.1
Func took 11.210918426514 microseconds<br />
Output for 5.6.0
Func took 13.998985290527 microseconds<br />
Output for 5.5.38
Func took 43.955087661743 microseconds<br />
Output for 5.5.37
Func took 10.770797729492 microseconds<br />
Output for 5.5.36
Func took 11.330842971802 microseconds<br />
Output for 5.5.35
Func took 10.954141616821 microseconds<br />
Output for 5.5.34
Func took 11.17992401123 microseconds<br />
Output for 5.5.33
Func took 11.667013168335 microseconds<br />
Output for 5.5.32
Func took 15.753030776978 microseconds<br />
Output for 5.5.31
Func took 11.168003082275 microseconds<br />
Output for 5.5.30
Func took 12.473106384277 microseconds<br />
Output for 5.5.29
Func took 40.188074111938 microseconds<br />
Output for 5.5.28
Func took 11.354923248291 microseconds<br />
Output for 5.5.27
Func took 17.18807220459 microseconds<br />
Output for 5.5.26
Func took 11.484861373901 microseconds<br />
Output for 5.5.25
Func took 14.104127883911 microseconds<br />
Output for 5.5.24
Func took 11.430025100708 microseconds<br />
Output for 5.5.23
Func took 25.390148162842 microseconds<br />
Output for 5.5.22
Func took 11.170864105225 microseconds<br />
Output for 5.5.21
Func took 39.396047592163 microseconds<br />
Output for 5.5.20
Func took 11.268138885498 microseconds<br />
Output for 5.5.19
Func took 11.435985565186 microseconds<br />
Output for 5.5.18
Func took 11.511087417603 microseconds<br />
Output for 5.5.17
Func took 11.236906051636 microseconds<br />
Output for 5.5.16
Func took 12.98999786377 microseconds<br />
Output for 5.5.15
Func took 11.542081832886 microseconds<br />
Output for 5.5.14
Func took 11.09790802002 microseconds<br />
Output for 5.4.24, 5.5.13
Func took 11.06595993042 microseconds<br />
Output for 5.5.12
Func took 11.406898498535 microseconds<br />
Output for 5.5.11
Func took 11.507987976074 microseconds<br />
Output for 5.4.25, 5.5.10
Func took 11.770009994507 microseconds<br />
Output for 5.5.9
Func took 10.937213897705 microseconds<br />
Output for 5.5.8
Func took 12.500047683716 microseconds<br />
Output for 5.4.26, 5.5.7
Func took 11.53302192688 microseconds<br />
Output for 5.5.6
Func took 11.505126953125 microseconds<br />
Output for 5.5.5
Func took 13.394832611084 microseconds<br />
Output for 5.5.4
Func took 13.031005859375 microseconds<br />
Output for 5.5.2
Func took 11.151075363159 microseconds<br />
Output for 5.5.1
Func took 11.523008346558 microseconds<br />
Output for 5.5.0
Func took 11.025905609131 microseconds<br />
Output for 5.4.45
Func took 12.738943099976 microseconds<br />
Output for 5.4.44
Func took 11.730909347534 microseconds<br />
Output for 5.4.43
Func took 13.086080551147 microseconds<br />
Output for 5.4.42
Func took 11.564016342163 microseconds<br />
Output for 5.4.41
Func took 11.101961135864 microseconds<br />
Output for 5.4.40
Func took 11.457920074463 microseconds<br />
Output for 5.4.39
Func took 11.514902114868 microseconds<br />
Output for 5.4.38
Func took 11.718034744263 microseconds<br />
Output for 5.4.37
Func took 11.723041534424 microseconds<br />
Output for 5.4.36
Func took 11.441946029663 microseconds<br />
Output for 5.4.35
Func took 11.304140090942 microseconds<br />
Output for 5.4.34
Func took 11.526823043823 microseconds<br />
Output for 5.4.33
Func took 11.065006256104 microseconds<br />
Output for 5.4.32
Func took 15.588045120239 microseconds<br />
Output for 5.4.31
Func took 13.571977615356 microseconds<br />
Output for 5.4.30
Func took 11.088132858276 microseconds<br />
Output for 5.4.29
Func took 12.80689239502 microseconds<br />
Output for 5.4.28
Func took 13.841152191162 microseconds<br />
Output for 5.4.27
Func took 11.447906494141 microseconds<br />
Output for 5.4.23
Func took 11.749982833862 microseconds<br />
Output for 5.4.22
Func took 17.421007156372 microseconds<br />
Output for 5.4.21
Func took 11.396884918213 microseconds<br />
Output for 5.4.20
Func took 10.991811752319 microseconds<br />
Output for 5.4.19
Func took 11.439800262451 microseconds<br />
Output for 5.4.18
Func took 11.293888092041 microseconds<br />
Output for 5.4.17
Func took 11.476039886475 microseconds<br />
Output for 5.4.16
Func took 11.276006698608 microseconds<br />
Output for 5.4.15
Func took 11.258125305176 microseconds<br />
Output for 5.4.14
Func took 11.194944381714 microseconds<br />
Output for 5.4.13
Func took 10.852098464966 microseconds<br />
Output for 5.4.12
Func took 11.311054229736 microseconds<br />
Output for 5.4.11
Func took 11.269092559814 microseconds<br />
Output for 5.4.10
Func took 11.253118515015 microseconds<br />
Output for 5.4.9
Func took 11.490106582642 microseconds<br />
Output for 5.4.8
Func took 12.274980545044 microseconds<br />
Output for 5.4.7
Func took 12.891054153442 microseconds<br />
Output for 5.4.6
Func took 13.29517364502 microseconds<br />
Output for 5.4.5
Func took 10.98895072937 microseconds<br />
Output for 5.4.4
Func took 11.343955993652 microseconds<br />
Output for 5.4.3
Func took 11.557102203369 microseconds<br />
Output for 5.4.2
Func took 11.721134185791 microseconds<br />
Output for 5.4.1
Func took 11.425971984863 microseconds<br />
Output for 5.4.0
Func took 11.279106140137 microseconds<br />
Output for 5.3.29
Func took 11.973142623901 microseconds<br />
Output for 5.3.28
Func took 13.195037841797 microseconds<br />
Output for 5.3.27
Func took 11.892080307007 microseconds<br />
Output for 5.3.26
Func took 11.566162109375 microseconds<br />
Output for 5.3.25
Func took 11.588096618652 microseconds<br />
Output for 5.3.24
Func took 11.468172073364 microseconds<br />
Output for 5.3.23
Func took 11.916160583496 microseconds<br />
Output for 5.3.22
Func took 13.106107711792 microseconds<br />
Output for 5.3.21
Func took 11.931180953979 microseconds<br />
Output for 5.3.20
Func took 13.95320892334 microseconds<br />
Output for 5.3.19
Func took 11.651992797852 microseconds<br />
Output for 5.3.18
Func took 11.86203956604 microseconds<br />
Output for 5.3.17
Func took 12.008190155029 microseconds<br />
Output for 5.3.16
Func took 12.189149856567 microseconds<br />
Output for 5.3.15
Func took 11.539220809937 microseconds<br />
Output for 5.3.14
Func took 11.573076248169 microseconds<br />
Output for 5.3.13
Func took 12.295007705688 microseconds<br />
Output for 5.3.12
Func took 12.299060821533 microseconds<br />
Output for 5.3.11
Func took 11.906147003174 microseconds<br />
Output for 5.3.0, 5.3.10
Func took 11.552095413208 microseconds<br />
Output for 5.3.9
Func took 46.606063842773 microseconds<br />
Output for 5.3.8
Func took 12.545108795166 microseconds<br />
Output for 5.3.7
Func took 12.371063232422 microseconds<br />
Output for 5.3.6
Func took 12.40611076355 microseconds<br />
Output for 5.3.5
Func took 19.365072250366 microseconds<br />
Output for 5.3.4
Func took 18.972158432007 microseconds<br />
Output for 5.3.3
Func took 12.164115905762 microseconds<br />
Output for 5.3.2
Func took 11.596202850342 microseconds<br />
Output for 5.3.1
Func took 12.050151824951 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/OlP0C 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/OlP0C 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/OlP0C 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/OlP0C on line 13
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/OlP0C on line 13
Process exited with code 255.

preferences:
213.61 ms | 401 KiB | 322 Q