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 (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.1.0
Func took 1.2271404266357 microseconds<br />
Output for 7.0.14
Func took 1.5969276428223 microseconds<br />
Output for 7.0.10
Func took 1.6570091247559 microseconds<br />
Output for 7.0.9
Func took 14.796018600464 microseconds<br />
Output for 7.0.8
Func took 1.507043838501 microseconds<br />
Output for 7.0.7
Func took 16.803979873657 microseconds<br />
Output for 7.0.6
Func took 11.420011520386 microseconds<br />
Output for 7.0.5
Func took 10.57505607605 microseconds<br />
Output for 7.0.4
Func took 1.5699863433838 microseconds<br />
Output for 7.0.3
Func took 1.6529560089111 microseconds<br />
Output for 7.0.2
Func took 1.0809898376465 microseconds<br />
Output for 7.0.1
Func took 1.1029243469238 microseconds<br />
Output for 7.0.0
Func took 1.2259483337402 microseconds<br />
Output for hhvm-3.12.0
Func took 3.2129287719727 microseconds<br />
Output for hhvm-3.10.0
Func took 3.950834274292 microseconds<br />
Output for 5.6.25
Func took 6.6690444946289 microseconds<br />
Output for 5.6.24
Func took 7.0581436157227 microseconds<br />
Output for 5.6.23
Func took 8.821964263916 microseconds<br />
Output for 5.6.22
Func took 7.1859359741211 microseconds<br />
Output for 5.6.21
Func took 8.1391334533691 microseconds<br />
Output for 5.6.20
Func took 11.895179748535 microseconds<br />
Output for 5.6.19
Func took 7.6260566711426 microseconds<br />
Output for 5.6.18
Func took 7.2591304779053 microseconds<br />
Output for 5.6.17
Func took 6.6790580749512 microseconds<br />
Output for 5.6.16
Func took 8.19993019104 microseconds<br />
Output for 5.6.15
Func took 6.2718391418457 microseconds<br />
Output for 5.6.14
Func took 7.8389644622803 microseconds<br />
Output for 5.6.13
Func took 6.9859027862549 microseconds<br />
Output for 5.6.12
Func took 5.9571266174316 microseconds<br />
Output for 5.6.11
Func took 6.1030387878418 microseconds<br />
Output for 5.6.10
Func took 6.6940784454346 microseconds<br />
Output for 5.6.9
Func took 6.7410469055176 microseconds<br />
Output for 5.6.8
Func took 6.138801574707 microseconds<br />
Output for 5.6.7
Func took 6.1159133911133 microseconds<br />
Output for 5.6.6
Func took 6.1109066009521 microseconds<br />
Output for 5.6.5
Func took 8.2039833068848 microseconds<br />
Output for 5.6.4
Func took 7.1008205413818 microseconds<br />
Output for 5.6.3
Func took 7.3530673980713 microseconds<br />
Output for 5.6.2
Func took 8.1710815429688 microseconds<br />
Output for 5.6.1
Func took 6.6759586334229 microseconds<br />
Output for 5.6.0
Func took 8.4969997406006 microseconds<br />
Output for 5.5.38
Func took 7.2710514068604 microseconds<br />
Output for 5.5.37
Func took 8.3680152893066 microseconds<br />
Output for 5.5.36
Func took 7.5168609619141 microseconds<br />
Output for 5.5.35
Func took 7.4279308319092 microseconds<br />
Output for 5.5.34
Func took 6.432056427002 microseconds<br />
Output for 5.5.33
Func took 7.7979564666748 microseconds<br />
Output for 5.5.32
Func took 8.6450576782227 microseconds<br />
Output for 5.5.31
Func took 8.1040859222412 microseconds<br />
Output for 5.5.30
Func took 7.5790882110596 microseconds<br />
Output for 5.5.29
Func took 7.6329708099365 microseconds<br />
Output for 5.5.28
Func took 6.0470104217529 microseconds<br />
Output for 5.5.27
Func took 5.7060718536377 microseconds<br />
Output for 5.5.26
Func took 6.2861442565918 microseconds<br />
Output for 5.5.25
Func took 6.6671371459961 microseconds<br />
Output for 5.5.24
Func took 5.742073059082 microseconds<br />
Output for 5.5.23
Func took 8.5861682891846 microseconds<br />
Output for 5.5.22
Func took 7.3249340057373 microseconds<br />
Output for 5.5.21
Func took 6.3772201538086 microseconds<br />
Output for 5.5.20
Func took 8.3041191101074 microseconds<br />
Output for 5.5.19
Func took 8.2399845123291 microseconds<br />
Output for 5.5.18
Func took 7.6389312744141 microseconds<br />
Output for 5.5.16
Func took 6.9220066070557 microseconds<br />
Output for 5.5.15
Func took 7.4338912963867 microseconds<br />
Output for 5.5.14
Func took 5.7559013366699 microseconds<br />
Output for 5.5.13
Func took 8.1138610839844 microseconds<br />
Output for 5.5.12
Func took 7.0822238922119 microseconds<br />
Output for 5.5.11
Func took 6.9301128387451 microseconds<br />
Output for 5.5.10
Func took 8.8210105895996 microseconds<br />
Output for 5.5.9
Func took 6.7460536956787 microseconds<br />
Output for 5.5.8
Func took 6.3009262084961 microseconds<br />
Output for 5.5.7
Func took 8.5029602050781 microseconds<br />
Output for 5.5.6
Func took 8.2998275756836 microseconds<br />
Output for 5.5.5
Func took 9.472131729126 microseconds<br />
Output for 5.5.4
Func took 8.371114730835 microseconds<br />
Output for 5.5.3
Func took 7.9128742218018 microseconds<br />
Output for 5.5.2
Func took 5.5770874023438 microseconds<br />
Output for 5.5.1
Func took 10.55383682251 microseconds<br />
Output for 5.5.0
Func took 7.451057434082 microseconds<br />
Output for 5.4.45
Func took 7.2860717773438 microseconds<br />
Output for 5.4.44
Func took 6.2811374664307 microseconds<br />
Output for 5.4.43
Func took 7.7831745147705 microseconds<br />
Output for 5.4.42
Func took 6.0710906982422 microseconds<br />
Output for 5.4.41
Func took 7.9848766326904 microseconds<br />
Output for 5.4.40
Func took 6.0129165649414 microseconds<br />
Output for 5.4.39
Func took 8.6109638214111 microseconds<br />
Output for 5.4.38
Func took 7.7838897705078 microseconds<br />
Output for 5.4.37
Func took 7.9500675201416 microseconds<br />
Output for 5.4.36
Func took 8.2859992980957 microseconds<br />
Output for 5.4.35
Func took 8.4459781646729 microseconds<br />
Output for 5.4.34
Func took 6.2680244445801 microseconds<br />
Output for 5.4.32
Func took 7.4200630187988 microseconds<br />
Output for 5.4.31
Func took 8.9230537414551 microseconds<br />
Output for 5.4.30
Func took 7.645845413208 microseconds<br />
Output for 5.4.29
Func took 6.1800479888916 microseconds<br />
Output for 5.4.28
Func took 11.132001876831 microseconds<br />
Output for 5.4.27
Func took 7.7319145202637 microseconds<br />
Output for 5.4.26
Func took 6.0198307037354 microseconds<br />
Output for 5.4.25
Func took 7.9069137573242 microseconds<br />
Output for 5.4.24
Func took 6.5548419952393 microseconds<br />
Output for 5.4.23
Func took 9.3011856079102 microseconds<br />
Output for 5.4.22
Func took 6.8650245666504 microseconds<br />
Output for 5.4.21
Func took 6.5250396728516 microseconds<br />
Output for 5.4.20
Func took 7.037878036499 microseconds<br />
Output for 5.4.19
Func took 6.850004196167 microseconds<br />
Output for 5.4.18
Func took 9.7229480743408 microseconds<br />
Output for 5.4.17
Func took 12.09282875061 microseconds<br />
Output for 5.4.16
Func took 9.3479156494141 microseconds<br />
Output for 5.4.15
Func took 6.1910152435303 microseconds<br />
Output for 5.4.14
Func took 8.6801052093506 microseconds<br />
Output for 5.4.13
Func took 10.571956634521 microseconds<br />
Output for 5.4.12
Func took 8.4810256958008 microseconds<br />
Output for 5.4.11
Func took 7.5929164886475 microseconds<br />
Output for 5.4.10
Func took 7.9190731048584 microseconds<br />
Output for 5.4.9
Func took 7.1089267730713 microseconds<br />
Output for 5.4.8
Func took 8.4209442138672 microseconds<br />
Output for 5.4.7
Func took 7.282018661499 microseconds<br />
Output for 5.4.6
Func took 5.342960357666 microseconds<br />
Output for 5.4.5
Func took 5.5499076843262 microseconds<br />
Output for 5.4.4
Func took 6.3431262969971 microseconds<br />
Output for 5.4.3
Func took 6.3719749450684 microseconds<br />
Output for 5.4.2
Func took 5.687952041626 microseconds<br />
Output for 5.4.1
Func took 5.7361125946045 microseconds<br />
Output for 5.4.0
Func took 6.5019130706787 microseconds<br />
Output for 5.3.29
Func took 8.5811614990234 microseconds<br />
Output for 5.3.28
Func took 6.8449974060059 microseconds<br />
Output for 5.3.27
Func took 5.6800842285156 microseconds<br />
Output for 5.3.26
Func took 8.8009834289551 microseconds<br />
Output for 5.3.25
Func took 5.7079792022705 microseconds<br />
Output for 5.3.24
Func took 6.5581798553467 microseconds<br />
Output for 5.3.23
Func took 7.4779987335205 microseconds<br />
Output for 5.3.22
Func took 8.3651542663574 microseconds<br />
Output for 5.3.21
Func took 8.3868503570557 microseconds<br />
Output for 5.3.20
Func took 7.2150230407715 microseconds<br />
Output for 5.3.19
Func took 6.7219734191895 microseconds<br />
Output for 5.3.18
Func took 5.9120655059814 microseconds<br />
Output for 5.3.17
Func took 8.0320835113525 microseconds<br />
Output for 5.3.16
Func took 5.6791305541992 microseconds<br />
Output for 5.3.15
Func took 8.4249973297119 microseconds<br />
Output for 5.3.14
Func took 6.558895111084 microseconds<br />
Output for 5.3.13
Func took 5.526065826416 microseconds<br />
Output for 5.3.12
Func took 7.390022277832 microseconds<br />
Output for 5.3.11
Func took 7.6079368591309 microseconds<br />
Output for 5.3.10
Func took 6.1290264129639 microseconds<br />
Output for 5.3.9
Func took 5.9268474578857 microseconds<br />
Output for 5.3.8
Func took 5.6829452514648 microseconds<br />
Output for 5.3.7
Func took 6.227970123291 microseconds<br />
Output for 5.3.6
Func took 5.565881729126 microseconds<br />
Output for 5.3.5
Func took 6.0720443725586 microseconds<br />
Output for 5.3.4
Func took 5.4631233215332 microseconds<br />
Output for 5.3.3
Func took 8.5890293121338 microseconds<br />
Output for 5.3.2
Func took 6.6530704498291 microseconds<br />
Output for 5.3.1
Func took 6.3059329986572 microseconds<br />
Output for 5.3.0
Func took 6.5779685974121 microseconds<br />
Output for 5.1.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.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.