3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?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.1.0
Func took 1.4779567718506 microseconds<br />
Output for 7.0.14
Func took 1.9538402557373 microseconds<br />
Output for 7.0.10
Func took 7.404088973999 microseconds<br />
Output for 7.0.9
Func took 7.5268745422363 microseconds<br />
Output for 7.0.8
Func took 2.255916595459 microseconds<br />
Output for 7.0.7
Func took 2.173900604248 microseconds<br />
Output for 7.0.6
Func took 2.9869079589844 microseconds<br />
Output for 7.0.5
Func took 2.2509098052979 microseconds<br />
Output for 7.0.4
Func took 1.7690658569336 microseconds<br />
Output for 7.0.3
Func took 1.6679763793945 microseconds<br />
Output for 7.0.2
Func took 1.8069744110107 microseconds<br />
Output for 7.0.1
Func took 1.4948844909668 microseconds<br />
Output for 7.0.0
Func took 1.384973526001 microseconds<br />
Output for 5.6.28
Func took 10.054111480713 microseconds<br />
Output for 5.6.25
Func took 8.9240074157715 microseconds<br />
Output for 5.6.24
Func took 8.2449913024902 microseconds<br />
Output for 5.6.23
Func took 6.9999694824219 microseconds<br />
Output for 5.6.22
Func took 9.7489356994629 microseconds<br />
Output for 5.6.21
Func took 9.037971496582 microseconds<br />
Output for 5.6.20
Func took 8.7020397186279 microseconds<br />
Output for 5.6.19
Func took 10.035037994385 microseconds<br />
Output for 5.6.18
Func took 10.597944259644 microseconds<br />
Output for 5.6.17
Func took 7.9097747802734 microseconds<br />
Output for 5.6.16
Func took 8.5740089416504 microseconds<br />
Output for 5.6.15
Func took 9.9871158599854 microseconds<br />
Output for 5.6.14
Func took 9.4599723815918 microseconds<br />
Output for 5.6.13
Func took 9.4008445739746 microseconds<br />
Output for 5.6.12
Func took 10.221004486084 microseconds<br />
Output for 5.6.11
Func took 8.4269046783447 microseconds<br />
Output for 5.6.10
Func took 9.8779201507568 microseconds<br />
Output for 5.6.9
Func took 9.8831653594971 microseconds<br />
Output for 5.6.8
Func took 8.8310241699219 microseconds<br />
Output for 5.6.7
Func took 7.8558921813965 microseconds<br />
Output for 5.6.6
Func took 10.040998458862 microseconds<br />
Output for 5.6.5
Func took 8.1307888031006 microseconds<br />
Output for 5.6.4
Func took 8.0661773681641 microseconds<br />
Output for 5.6.3
Func took 10.288953781128 microseconds<br />
Output for 5.6.2
Func took 10.171890258789 microseconds<br />
Output for 5.6.1
Func took 9.0341567993164 microseconds<br />
Output for 5.6.0
Func took 7.0838928222656 microseconds<br />
Output for 5.5.38
Func took 8.364200592041 microseconds<br />
Output for 5.5.37
Func took 7.0970058441162 microseconds<br />
Output for 5.5.36
Func took 9.8822116851807 microseconds<br />
Output for 5.5.35
Func took 8.901834487915 microseconds<br />
Output for 5.5.34
Func took 9.0138912200928 microseconds<br />
Output for 5.5.33
Func took 10.241985321045 microseconds<br />
Output for 5.5.32
Func took 9.5951557159424 microseconds<br />
Output for 5.5.31
Func took 7.0810317993164 microseconds<br />
Output for 5.5.30
Func took 10.33091545105 microseconds<br />
Output for 5.5.29
Func took 9.0770721435547 microseconds<br />
Output for 5.5.28
Func took 10.142087936401 microseconds<br />
Output for 5.5.27
Func took 10.493040084839 microseconds<br />
Output for 5.5.26
Func took 7.3931217193604 microseconds<br />
Output for 5.5.25
Func took 9.3340873718262 microseconds<br />
Output for 5.5.24
Func took 8.2828998565674 microseconds<br />
Output for 5.5.23
Func took 8.3608627319336 microseconds<br />
Output for 5.5.22
Func took 7.7250003814697 microseconds<br />
Output for 5.5.21
Func took 10.56694984436 microseconds<br />
Output for 5.5.20
Func took 10.02311706543 microseconds<br />
Output for 5.5.19
Func took 9.4571113586426 microseconds<br />
Output for 5.5.18
Func took 8.0978870391846 microseconds<br />
Output for 5.5.16
Func took 8.8341236114502 microseconds<br />
Output for 5.5.15
Func took 9.9809169769287 microseconds<br />
Output for 5.5.14
Func took 6.7012310028076 microseconds<br />
Output for 5.5.13
Func took 6.7520141601562 microseconds<br />
Output for 5.5.12
Func took 7.1730613708496 microseconds<br />
Output for 5.5.11
Func took 6.519079208374 microseconds<br />
Output for 5.5.10
Func took 6.7288875579834 microseconds<br />
Output for 5.5.9
Func took 10.274171829224 microseconds<br />
Output for 5.5.8
Func took 9.9658966064453 microseconds<br />
Output for 5.5.7
Func took 8.85009765625 microseconds<br />
Output for 5.5.6
Func took 7.087230682373 microseconds<br />
Output for 5.5.5
Func took 6.6378116607666 microseconds<br />
Output for 5.5.4
Func took 7.3559284210205 microseconds<br />
Output for 5.5.3
Func took 6.6440105438232 microseconds<br />
Output for 5.5.2
Func took 7.0240497589111 microseconds<br />
Output for 5.5.1
Func took 6.9851875305176 microseconds<br />
Output for 5.5.0
Func took 8.173942565918 microseconds<br />
Output for 5.4.45
Func took 8.7800025939941 microseconds<br />
Output for 5.4.44
Func took 10.089874267578 microseconds<br />
Output for 5.4.43
Func took 9.2039108276367 microseconds<br />
Output for 5.4.42
Func took 8.8679790496826 microseconds<br />
Output for 5.4.41
Func took 10.443925857544 microseconds<br />
Output for 5.4.40
Func took 9.077787399292 microseconds<br />
Output for 5.4.39
Func took 9.7649097442627 microseconds<br />
Output for 5.4.38
Func took 9.9701881408691 microseconds<br />
Output for 5.4.37
Func took 10.770082473755 microseconds<br />
Output for 5.4.36
Func took 9.8428726196289 microseconds<br />
Output for 5.4.35
Func took 8.7821483612061 microseconds<br />
Output for 5.4.34
Func took 8.7141990661621 microseconds<br />
Output for 5.4.32
Func took 8.0599784851074 microseconds<br />
Output for 5.4.31
Func took 7.476806640625 microseconds<br />
Output for 5.4.30
Func took 6.7160129547119 microseconds<br />
Output for 5.4.29
Func took 6.9770812988281 microseconds<br />
Output for 5.4.28
Func took 6.8490505218506 microseconds<br />
Output for 5.4.27
Func took 7.6391696929932 microseconds<br />
Output for 5.4.26
Func took 6.9260597229004 microseconds<br />
Output for 5.4.25
Func took 6.6180229187012 microseconds<br />
Output for 5.4.24
Func took 8.6579322814941 microseconds<br />
Output for 5.4.23
Func took 6.5469741821289 microseconds<br />
Output for 5.4.22
Func took 7.5950622558594 microseconds<br />
Output for 5.4.21
Func took 7.6889991760254 microseconds<br />
Output for 5.4.20
Func took 6.6499710083008 microseconds<br />
Output for 5.4.19
Func took 6.9191455841064 microseconds<br />
Output for 5.4.18
Func took 8.8648796081543 microseconds<br />
Output for 5.4.17
Func took 6.7660808563232 microseconds<br />
Output for 5.4.16
Func took 7.8418254852295 microseconds<br />
Output for 5.4.15
Func took 6.7529678344727 microseconds<br />
Output for 5.4.14
Func took 7.0099830627441 microseconds<br />
Output for 5.4.13
Func took 9.8130702972412 microseconds<br />
Output for 5.4.12
Func took 7.2641372680664 microseconds<br />
Output for 5.4.11
Func took 6.8769454956055 microseconds<br />
Output for 5.4.10
Func took 9.5689296722412 microseconds<br />
Output for 5.4.9
Func took 6.5300464630127 microseconds<br />
Output for 5.4.8
Func took 8.1548690795898 microseconds<br />
Output for 5.4.7
Func took 6.9169998168945 microseconds<br />
Output for 5.4.6
Func took 7.4801445007324 microseconds<br />
Output for 5.4.5
Func took 7.2271823883057 microseconds<br />
Output for 5.4.4
Func took 7.1759223937988 microseconds<br />
Output for 5.4.3
Func took 7.1990489959717 microseconds<br />
Output for 5.4.2
Func took 10.403156280518 microseconds<br />
Output for 5.4.1
Func took 11.039018630981 microseconds<br />
Output for 5.4.0
Func took 11.213064193726 microseconds<br />
Output for 5.3.29
Func took 7.4100494384766 microseconds<br />
Output for 5.3.28
Func took 10.053873062134 microseconds<br />
Output for 5.3.27
Func took 8.2759857177734 microseconds<br />
Output for 5.3.26
Func took 9.6957683563232 microseconds<br />
Output for 5.3.25
Func took 6.7851543426514 microseconds<br />
Output for 5.3.24
Func took 7.2629451751709 microseconds<br />
Output for 5.3.23
Func took 7.023811340332 microseconds<br />
Output for 5.3.22
Func took 7.108211517334 microseconds<br />
Output for 5.3.21
Func took 6.8888664245605 microseconds<br />
Output for 5.3.20
Func took 7.3308944702148 microseconds<br />
Output for 5.3.19
Func took 7.1549415588379 microseconds<br />
Output for 5.3.18
Func took 9.7219944000244 microseconds<br />
Output for 5.3.17
Func took 7.0538520812988 microseconds<br />
Output for 5.3.16
Func took 6.8199634552002 microseconds<br />
Output for 5.3.15
Func took 9.3951225280762 microseconds<br />
Output for 5.3.14
Func took 7.6019763946533 microseconds<br />
Output for 5.3.13
Func took 9.984016418457 microseconds<br />
Output for 5.3.12
Func took 11.142015457153 microseconds<br />
Output for 5.3.11
Func took 10.246992111206 microseconds<br />
Output for 5.3.10
Func took 9.3040466308594 microseconds<br />
Output for 5.3.9
Func took 11.980772018433 microseconds<br />
Output for 5.3.8
Func took 10.794878005981 microseconds<br />
Output for 5.3.7
Func took 9.4139575958252 microseconds<br />
Output for 5.3.6
Func took 10.215997695923 microseconds<br />
Output for 5.3.5
Func took 9.5529556274414 microseconds<br />
Output for 5.3.4
Func took 9.9380016326904 microseconds<br />
Output for 5.3.3
Func took 9.5200538635254 microseconds<br />
Output for 5.3.2
Func took 9.6089839935303 microseconds<br />
Output for 5.3.1
Func took 11.332035064697 microseconds<br />
Output for 5.3.0
Func took 10.15305519104 microseconds<br />
Output for 5.1.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.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.