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.1239051818848 microseconds<br />
Output for 7.4.0
Func took 1.0900497436523 microseconds<br />
Output for 7.3.13
Func took 1.1179447174072 microseconds<br />
Output for 7.3.12
Func took 1.0130405426025 microseconds<br />
Output for 7.3.11
Func took 0.75697898864746 microseconds<br />
Output for 7.3.10
Func took 1.0151863098145 microseconds<br />
Output for 7.3.9
Func took 0.73099136352539 microseconds<br />
Output for 7.3.8
Func took 0.8089542388916 microseconds<br />
Output for 7.3.7
Func took 1.0650157928467 microseconds<br />
Output for 7.2.21, 7.3.6
Func took 0.72693824768066 microseconds<br />
Output for 7.3.5
Func took 0.71907043457031 microseconds<br />
Output for 7.3.4
Func took 0.7319450378418 microseconds<br />
Output for 7.3.3
Func took 1.0409355163574 microseconds<br />
Output for 7.3.2
Func took 0.73599815368652 microseconds<br />
Output for 7.3.1
Func took 0.91290473937988 microseconds<br />
Output for 7.3.0
Func took 0.93984603881836 microseconds<br />
Output for 7.2.26
Func took 1.0099411010742 microseconds<br />
Output for 7.2.25
Func took 1.0719299316406 microseconds<br />
Output for 7.2.24
Func took 1.1308193206787 microseconds<br />
Output for 7.2.23
Func took 0.9758472442627 microseconds<br />
Output for 7.2.22
Func took 1.0898113250732 microseconds<br />
Output for 7.2.20
Func took 0.68807601928711 microseconds<br />
Output for 7.2.19
Func took 0.72312355041504 microseconds<br />
Output for 7.2.18
Func took 0.77199935913086 microseconds<br />
Output for 7.2.17
Func took 0.95915794372559 microseconds<br />
Output for 7.2.16
Func took 0.67806243896484 microseconds<br />
Output for 7.2.15
Func took 0.7789134979248 microseconds<br />
Output for 7.2.14
Func took 0.7469654083252 microseconds<br />
Output for 7.2.13
Func took 0.7021427154541 microseconds<br />
Output for 7.2.12
Func took 0.78892707824707 microseconds<br />
Output for 7.2.11
Func took 0.69594383239746 microseconds<br />
Output for 7.2.10
Func took 0.65493583679199 microseconds<br />
Output for 7.2.9
Func took 0.9000301361084 microseconds<br />
Output for 7.2.8
Func took 0.70381164550781 microseconds<br />
Output for 7.2.7
Func took 0.62704086303711 microseconds<br />
Output for 7.2.6
Func took 0.62298774719238 microseconds<br />
Output for 7.1.22, 7.2.5
Func took 0.7929801940918 microseconds<br />
Output for 7.2.4
Func took 0.6561279296875 microseconds<br />
Output for 7.2.3
Func took 0.61297416687012 microseconds<br />
Output for 7.2.2
Func took 0.65207481384277 microseconds<br />
Output for 7.2.1
Func took 0.77104568481445 microseconds<br />
Output for 7.2.0
Func took 0.59986114501953 microseconds<br />
Output for 7.1.33
Func took 0.89216232299805 microseconds<br />
Output for 7.1.32
Func took 1.3301372528076 microseconds<br />
Output for 7.1.31
Func took 1.1270046234131 microseconds<br />
Output for 7.1.30
Func took 1.1558532714844 microseconds<br />
Output for 7.1.29
Func took 0.88691711425781 microseconds<br />
Output for 7.1.28
Func took 0.85306167602539 microseconds<br />
Output for 7.1.27
Func took 1.007080078125 microseconds<br />
Output for 7.0.23, 7.1.26
Func took 0.88000297546387 microseconds<br />
Output for 7.1.25
Func took 1.1169910430908 microseconds<br />
Output for 7.1.24
Func took 0.81300735473633 microseconds<br />
Output for 7.1.23
Func took 0.78392028808594 microseconds<br />
Output for 7.1.21
Func took 0.72598457336426 microseconds<br />
Output for 7.1.20
Func took 0.80394744873047 microseconds<br />
Output for 7.1.19
Func took 1.2519359588623 microseconds<br />
Output for 7.1.18
Func took 1.0850429534912 microseconds<br />
Output for 7.1.17
Func took 0.92077255249023 microseconds<br />
Output for 7.1.16
Func took 1.1451244354248 microseconds<br />
Output for 7.0.17, 7.1.15
Func took 0.74505805969238 microseconds<br />
Output for 7.1.14
Func took 0.76818466186523 microseconds<br />
Output for 7.1.13
Func took 1.3329982757568 microseconds<br />
Output for 7.1.12
Func took 0.77009201049805 microseconds<br />
Output for 7.1.11
Func took 1.1129379272461 microseconds<br />
Output for 7.1.10
Func took 1.0089874267578 microseconds<br />
Output for 7.1.9
Func took 0.82087516784668 microseconds<br />
Output for 7.0.3, 7.1.8
Func took 0.79512596130371 microseconds<br />
Output for 7.1.7
Func took 1.0108947753906 microseconds<br />
Output for 7.1.6
Func took 0.81110000610352 microseconds<br />
Output for 7.1.5
Func took 0.86402893066406 microseconds<br />
Output for 7.1.4
Func took 0.83780288696289 microseconds<br />
Output for 7.1.3
Func took 1.3220310211182 microseconds<br />
Output for 7.1.2
Func took 0.80204010009766 microseconds<br />
Output for 7.1.1
Func took 0.91099739074707 microseconds<br />
Output for 7.1.0
Func took 1.0600090026855 microseconds<br />
Output for 7.0.33
Func took 0.82707405090332 microseconds<br />
Output for 7.0.32
Func took 0.79488754272461 microseconds<br />
Output for 7.0.31
Func took 0.82898139953613 microseconds<br />
Output for 7.0.30
Func took 1.1157989501953 microseconds<br />
Output for 7.0.29
Func took 0.9150505065918 microseconds<br />
Output for 7.0.28
Func took 0.85115432739258 microseconds<br />
Output for 7.0.27
Func took 1.1730194091797 microseconds<br />
Output for 7.0.26
Func took 1.0139942169189 microseconds<br />
Output for 7.0.25
Func took 0.74005126953125 microseconds<br />
Output for 7.0.24
Func took 0.89120864868164 microseconds<br />
Output for 7.0.22
Func took 0.98490715026855 microseconds<br />
Output for 7.0.21
Func took 0.89287757873535 microseconds<br />
Output for 7.0.12, 7.0.20
Func took 0.89907646179199 microseconds<br />
Output for 7.0.19
Func took 0.82302093505859 microseconds<br />
Output for 7.0.18
Func took 0.762939453125 microseconds<br />
Output for 7.0.16
Func took 1.1639595031738 microseconds<br />
Output for 7.0.15
Func took 0.82778930664062 microseconds<br />
Output for 7.0.14
Func took 1.0008811950684 microseconds<br />
Output for 7.0.13
Func took 0.78606605529785 microseconds<br />
Output for 7.0.11
Func took 0.85210800170898 microseconds<br />
Output for 7.0.10
Func took 0.84686279296875 microseconds<br />
Output for 7.0.9
Func took 1.1889934539795 microseconds<br />
Output for 7.0.8
Func took 1.3611316680908 microseconds<br />
Output for 7.0.7
Func took 0.99086761474609 microseconds<br />
Output for 7.0.6
Func took 0.95987319946289 microseconds<br />
Output for 7.0.5
Func took 0.76699256896973 microseconds<br />
Output for 7.0.4
Func took 1.1999607086182 microseconds<br />
Output for 7.0.2
Func took 0.76603889465332 microseconds<br />
Output for 7.0.1
Func took 0.95510482788086 microseconds<br />
Output for 7.0.0
Func took 0.95486640930176 microseconds<br />
Output for 5.6.40
Func took 3.4260749816895 microseconds<br />
Output for 5.6.39
Func took 3.1030178070068 microseconds<br />
Output for 5.6.38
Func took 3.2000541687012 microseconds<br />
Output for 5.6.37
Func took 2.8560161590576 microseconds<br />
Output for 5.6.32, 5.6.36
Func took 2.8069019317627 microseconds<br />
Output for 5.6.35
Func took 3.0419826507568 microseconds<br />
Output for 5.6.34
Func took 3.3280849456787 microseconds<br />
Output for 5.6.33
Func took 3.5049915313721 microseconds<br />
Output for 5.6.31
Func took 2.938985824585 microseconds<br />
Output for 5.6.30
Func took 2.9199123382568 microseconds<br />
Output for 5.6.29
Func took 3.5099983215332 microseconds<br />
Output for 5.6.28
Func took 4.429817199707 microseconds<br />
Output for 5.6.27
Func took 3.5130977630615 microseconds<br />
Output for 5.6.26
Func took 2.9938220977783 microseconds<br />
Output for 5.6.25
Func took 3.0548572540283 microseconds<br />
Output for 5.6.24
Func took 2.8970241546631 microseconds<br />
Output for 5.6.23
Func took 3.2191276550293 microseconds<br />
Output for 5.6.22
Func took 2.9020309448242 microseconds<br />
Output for 5.6.21
Func took 2.8700828552246 microseconds<br />
Output for 5.6.20
Func took 3.000020980835 microseconds<br />
Output for 5.6.19
Func took 3.3068656921387 microseconds<br />
Output for 5.6.18
Func took 3.0758380889893 microseconds<br />
Output for 5.6.17
Func took 3.5109519958496 microseconds<br />
Output for 5.6.16
Func took 3.032922744751 microseconds<br />
Output for 5.6.15
Func took 3.0438899993896 microseconds<br />
Output for 5.6.14
Func took 3.6690235137939 microseconds<br />
Output for 5.6.13
Func took 2.9869079589844 microseconds<br />
Output for 5.6.12
Func took 3.0109882354736 microseconds<br />
Output for 5.6.11
Func took 3.7360191345215 microseconds<br />
Output for 5.6.10
Func took 3.878116607666 microseconds<br />
Output for 5.6.9
Func took 2.8579235076904 microseconds<br />
Output for 5.6.8
Func took 2.9089450836182 microseconds<br />
Output for 5.6.7
Func took 3.3628940582275 microseconds<br />
Output for 5.6.6
Func took 3.2138824462891 microseconds<br />
Output for 5.6.5
Func took 3.2410621643066 microseconds<br />
Output for 5.6.4
Func took 2.816915512085 microseconds<br />
Output for 5.6.3
Func took 2.9280185699463 microseconds<br />
Output for 5.6.2
Func took 2.8679370880127 microseconds<br />
Output for 5.6.1
Func took 2.9668807983398 microseconds<br />
Output for 5.6.0
Func took 3.4880638122559 microseconds<br />
Output for 5.5.38
Func took 2.8839111328125 microseconds<br />
Output for 5.5.37
Func took 2.8901100158691 microseconds<br />
Output for 5.5.36
Func took 3.0128955841064 microseconds<br />
Output for 5.5.35
Func took 3.1440258026123 microseconds<br />
Output for 5.5.34
Func took 4.2910575866699 microseconds<br />
Output for 5.5.33
Func took 3.183126449585 microseconds<br />
Output for 5.5.32
Func took 3.3559799194336 microseconds<br />
Output for 5.5.31
Func took 3.1251907348633 microseconds<br />
Output for 5.5.30
Func took 3.5140514373779 microseconds<br />
Output for 5.5.29
Func took 2.964973449707 microseconds<br />
Output for 5.5.28
Func took 3.5860538482666 microseconds<br />
Output for 5.5.26 - 5.5.27
Func took 2.9129981994629 microseconds<br />
Output for 5.5.25
Func took 3.4329891204834 microseconds<br />
Output for 5.5.24
Func took 3.8440227508545 microseconds<br />
Output for 5.5.23
Func took 3.4370422363281 microseconds<br />
Output for 5.5.22
Func took 3.2498836517334 microseconds<br />
Output for 5.5.21
Func took 4.3399333953857 microseconds<br />
Output for 5.5.20
Func took 2.910852432251 microseconds<br />
Output for 5.5.19
Func took 3.0059814453125 microseconds<br />
Output for 5.5.18
Func took 3.0491352081299 microseconds<br />
Output for 5.5.17
Func took 2.9561519622803 microseconds<br />
Output for 5.4.43, 5.5.16
Func took 3.587007522583 microseconds<br />
Output for 5.5.15
Func took 2.9470920562744 microseconds<br />
Output for 5.5.14
Func took 3.4859180450439 microseconds<br />
Output for 5.5.13
Func took 4.0130615234375 microseconds<br />
Output for 5.5.12
Func took 3.122091293335 microseconds<br />
Output for 5.5.11
Func took 3.277063369751 microseconds<br />
Output for 5.5.10
Func took 3.0889511108398 microseconds<br />
Output for 5.5.9
Func took 3.0739307403564 microseconds<br />
Output for 5.5.8
Func took 2.9520988464355 microseconds<br />
Output for 5.5.7
Func took 2.9289722442627 microseconds<br />
Output for 5.5.6
Func took 3.1359195709229 microseconds<br />
Output for 5.5.5
Func took 4.3380260467529 microseconds<br />
Output for 5.5.4
Func took 4.3971538543701 microseconds<br />
Output for 5.5.3
Func took 3.3807754516602 microseconds<br />
Output for 5.5.2
Func took 3.0200481414795 microseconds<br />
Output for 5.5.1
Func took 2.9900074005127 microseconds<br />
Output for 5.5.0
Func took 3.324031829834 microseconds<br />
Output for 5.4.45
Func took 3.5908222198486 microseconds<br />
Output for 5.4.44
Func took 3.0660629272461 microseconds<br />
Output for 5.3.17, 5.4.42
Func took 4.0950775146484 microseconds<br />
Output for 5.4.41
Func took 2.997875213623 microseconds<br />
Output for 5.4.40
Func took 3.0720233917236 microseconds<br />
Output for 5.4.39
Func took 3.0322074890137 microseconds<br />
Output for 5.4.38
Func took 2.8040409088135 microseconds<br />
Output for 5.4.37
Func took 2.9139518737793 microseconds<br />
Output for 5.4.36
Func took 3.3619403839111 microseconds<br />
Output for 5.4.35
Func took 3.497838973999 microseconds<br />
Output for 5.4.34
Func took 3.5901069641113 microseconds<br />
Output for 5.4.33
Func took 3.0949115753174 microseconds<br />
Output for 5.4.32
Func took 3.5309791564941 microseconds<br />
Output for 5.4.31
Func took 3.0009746551514 microseconds<br />
Output for 5.4.30
Func took 3.0369758605957 microseconds<br />
Output for 5.4.29
Func took 2.9511451721191 microseconds<br />
Output for 5.4.28
Func took 4.1069984436035 microseconds<br />
Output for 5.4.27
Func took 3.0860900878906 microseconds<br />
Output for 5.4.26
Func took 4.4779777526855 microseconds<br />
Output for 5.4.25
Func took 3.5271644592285 microseconds<br />
Output for 5.4.24
Func took 3.0021667480469 microseconds<br />
Output for 5.4.23
Func took 3.5851001739502 microseconds<br />
Output for 5.4.22
Func took 4.4870376586914 microseconds<br />
Output for 5.4.21
Func took 4.4498443603516 microseconds<br />
Output for 5.4.20
Func took 3.1368732452393 microseconds<br />
Output for 5.4.19
Func took 4.4598579406738 microseconds<br />
Output for 5.4.18
Func took 3.4999847412109 microseconds<br />
Output for 5.4.17
Func took 2.9981136322021 microseconds<br />
Output for 5.4.16
Func took 4.3289661407471 microseconds<br />
Output for 5.4.15
Func took 3.9839744567871 microseconds<br />
Output for 5.4.14
Func took 2.88987159729 microseconds<br />
Output for 5.4.13
Func took 3.0190944671631 microseconds<br />
Output for 5.4.12
Func took 3.4410953521729 microseconds<br />
Output for 5.4.11
Func took 3.4849643707275 microseconds<br />
Output for 5.4.10
Func took 3.2281875610352 microseconds<br />
Output for 5.4.9
Func took 3.0391216278076 microseconds<br />
Output for 5.4.8
Func took 3.0980110168457 microseconds<br />
Output for 5.4.7
Func took 3.2198429107666 microseconds<br />
Output for 5.4.6
Func took 3.1411647796631 microseconds<br />
Output for 5.4.5
Func took 3.1259059906006 microseconds<br />
Output for 5.4.4
Func took 2.9919147491455 microseconds<br />
Output for 5.4.3
Func took 2.9988288879395 microseconds<br />
Output for 5.4.2
Func took 2.8610229492188 microseconds<br />
Output for 5.4.1
Func took 2.9840469360352 microseconds<br />
Output for 5.4.0
Func took 3.1461715698242 microseconds<br />
Output for 5.3.29
Func took 2.9811859130859 microseconds<br />
Output for 5.3.28
Func took 3.5982131958008 microseconds<br />
Output for 5.3.27
Func took 3.8530826568604 microseconds<br />
Output for 5.3.26
Func took 4.2362213134766 microseconds<br />
Output for 5.3.25
Func took 2.9950141906738 microseconds<br />
Output for 5.3.24
Func took 3.3891201019287 microseconds<br />
Output for 5.3.23
Func took 3.3960342407227 microseconds<br />
Output for 5.3.22
Func took 3.0062198638916 microseconds<br />
Output for 5.3.21
Func took 2.9881000518799 microseconds<br />
Output for 5.3.20
Func took 4.033088684082 microseconds<br />
Output for 5.3.19
Func took 3.5672187805176 microseconds<br />
Output for 5.3.18
Func took 4.6629905700684 microseconds<br />
Output for 5.3.16
Func took 3.1630992889404 microseconds<br />
Output for 5.3.15
Func took 3.7331581115723 microseconds<br />
Output for 5.3.14
Func took 4.4031143188477 microseconds<br />
Output for 5.3.13
Func took 3.4570693969727 microseconds<br />
Output for 5.3.12
Func took 2.8631687164307 microseconds<br />
Output for 5.3.11
Func took 3.9761066436768 microseconds<br />
Output for 5.3.10
Func took 3.4282207489014 microseconds<br />
Output for 5.3.9
Func took 2.8600692749023 microseconds<br />
Output for 5.3.8
Func took 3.7481784820557 microseconds<br />
Output for 5.3.7
Func took 4.3392181396484 microseconds<br />
Output for 5.3.6
Func took 2.9749870300293 microseconds<br />
Output for 5.3.5
Func took 2.9540061950684 microseconds<br />
Output for 5.3.4
Func took 2.9702186584473 microseconds<br />
Output for 5.3.3
Func took 4.2221546173096 microseconds<br />
Output for 5.3.2
Func took 3.1211376190186 microseconds<br />
Output for 5.3.1
Func took 3.4401416778564 microseconds<br />
Output for 5.3.0
Func took 4.1561126708984 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/mTvKJ 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/mTvKJ 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/mTvKJ 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/mTvKJ on line 13
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/mTvKJ on line 13
Process exited with code 255.

preferences:
277.13 ms | 401 KiB | 325 Q