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]) || 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.3.1
Func took 1.6701221466064 microseconds<br />
Output for 7.3.0
Func took 0.9610652923584 microseconds<br />
Output for 7.2.13
Func took 0.9768009185791 microseconds<br />
Output for 7.2.12
Func took 0.92506408691406 microseconds<br />
Output for 7.2.8, 7.2.11
Func took 1.0149478912354 microseconds<br />
Output for 7.2.10
Func took 1.3470649719238 microseconds<br />
Output for 7.2.9
Func took 0.8399486541748 microseconds<br />
Output for 7.2.7
Func took 0.89883804321289 microseconds<br />
Output for 7.2.6
Func took 1.4619827270508 microseconds<br />
Output for 7.2.5
Func took 0.98705291748047 microseconds<br />
Output for 7.2.4
Func took 5.5398941040039 microseconds<br />
Output for 7.2.3
Func took 0.81515312194824 microseconds<br />
Output for 7.2.2
Func took 1.0840892791748 microseconds<br />
Output for 7.2.1
Func took 0.79798698425293 microseconds<br />
Output for 7.2.0
Func took 1.1360645294189 microseconds<br />
Output for 7.1.25
Func took 1.370906829834 microseconds<br />
Output for 7.1.24
Func took 1.3880729675293 microseconds<br />
Output for 7.1.23
Func took 1.5668869018555 microseconds<br />
Output for 7.1.22
Func took 2.1510124206543 microseconds<br />
Output for 7.1.21
Func took 1.716136932373 microseconds<br />
Output for 7.1.20
Func took 2.2799968719482 microseconds<br />
Output for 7.1.19
Func took 1.7471313476562 microseconds<br />
Output for 7.1.18
Func took 1.8129348754883 microseconds<br />
Output for 7.1.17
Func took 4.6741962432861 microseconds<br />
Output for 7.1.16
Func took 1.2390613555908 microseconds<br />
Output for 7.1.15
Func took 1.4870166778564 microseconds<br />
Output for 7.1.14
Func took 4.3790340423584 microseconds<br />
Output for 7.1.13
Func took 1.1789798736572 microseconds<br />
Output for 7.1.12
Func took 1.1889934539795 microseconds<br />
Output for 7.1.11
Func took 1.1701583862305 microseconds<br />
Output for 7.0.24, 7.1.10
Func took 1.1610984802246 microseconds<br />
Output for 7.1.9
Func took 4.8260688781738 microseconds<br />
Output for 7.1.8
Func took 2.068042755127 microseconds<br />
Output for 7.1.7
Func took 5.0129890441895 microseconds<br />
Output for 7.1.6
Func took 1.168966293335 microseconds<br />
Output for 7.1.5
Func took 1.2359619140625 microseconds<br />
Output for 7.1.4
Func took 1.6200542449951 microseconds<br />
Output for 7.1.3
Func took 5.6250095367432 microseconds<br />
Output for 7.1.2
Func took 4.9870014190674 microseconds<br />
Output for 7.1.1
Func took 1.9540786743164 microseconds<br />
Output for 7.1.0
Func took 1.2941360473633 microseconds<br />
Output for 7.0.33
Func took 1.9779205322266 microseconds<br />
Output for 7.0.32
Func took 1.4050006866455 microseconds<br />
Output for 7.0.31
Func took 5.6180953979492 microseconds<br />
Output for 7.0.30
Func took 4.8789978027344 microseconds<br />
Output for 7.0.29
Func took 1.2829303741455 microseconds<br />
Output for 7.0.28
Func took 1.276969909668 microseconds<br />
Output for 7.0.27
Func took 1.6520023345947 microseconds<br />
Output for 7.0.26
Func took 1.1770725250244 microseconds<br />
Output for 7.0.12, 7.0.25
Func took 1.5161037445068 microseconds<br />
Output for 7.0.23
Func took 3.9031505584717 microseconds<br />
Output for 7.0.22
Func took 1.1870861053467 microseconds<br />
Output for 7.0.21
Func took 1.4948844909668 microseconds<br />
Output for 7.0.20
Func took 6.5329074859619 microseconds<br />
Output for 7.0.19
Func took 1.1579990386963 microseconds<br />
Output for 7.0.18
Func took 4.734992980957 microseconds<br />
Output for 7.0.17
Func took 4.6930313110352 microseconds<br />
Output for 7.0.16
Func took 6.2630176544189 microseconds<br />
Output for 7.0.15
Func took 1.4119148254395 microseconds<br />
Output for 7.0.14
Func took 1.6541481018066 microseconds<br />
Output for 7.0.13
Func took 1.2528896331787 microseconds<br />
Output for 7.0.11
Func took 1.54709815979 microseconds<br />
Output for 7.0.10
Func took 1.3411045074463 microseconds<br />
Output for 7.0.9
Func took 1.7080307006836 microseconds<br />
Output for 7.0.8
Func took 2.0530223846436 microseconds<br />
Output for 7.0.7
Func took 10.309934616089 microseconds<br />
Output for 7.0.6
Func took 1.5530586242676 microseconds<br />
Output for 7.0.5
Func took 1.3988018035889 microseconds<br />
Output for 7.0.4
Func took 1.5270709991455 microseconds<br />
Output for 7.0.3
Func took 1.2259483337402 microseconds<br />
Output for 7.0.2
Func took 1.4238357543945 microseconds<br />
Output for 7.0.1
Func took 1.5871524810791 microseconds<br />
Output for 7.0.0
Func took 1.427173614502 microseconds<br />
Output for 5.6.38
Func took 3.2439231872559 microseconds<br />
Output for 5.6.37
Func took 3.3600330352783 microseconds<br />
Output for 5.6.36
Func took 3.4229755401611 microseconds<br />
Output for 5.4.18, 5.6.35
Func took 4.2128562927246 microseconds<br />
Output for 5.5.26, 5.6.34
Func took 3.187894821167 microseconds<br />
Output for 5.6.33
Func took 3.1921863555908 microseconds<br />
Output for 5.6.32
Func took 3.5960674285889 microseconds<br />
Output for 5.6.31
Func took 3.2918453216553 microseconds<br />
Output for 5.6.30
Func took 4.3349266052246 microseconds<br />
Output for 5.6.29
Func took 3.6158561706543 microseconds<br />
Output for 5.6.28
Func took 3.2889842987061 microseconds<br />
Output for 5.6.27
Func took 3.2849311828613 microseconds<br />
Output for 5.6.26
Func took 3.5769939422607 microseconds<br />
Output for 5.6.25
Func took 3.2689571380615 microseconds<br />
Output for 5.6.24
Func took 3.5338401794434 microseconds<br />
Output for 5.4.31, 5.6.23
Func took 3.4999847412109 microseconds<br />
Output for 5.6.22
Func took 3.1371116638184 microseconds<br />
Output for 5.6.21
Func took 3.338098526001 microseconds<br />
Output for 5.6.20
Func took 3.6771297454834 microseconds<br />
Output for 5.6.19
Func took 4.3179988861084 microseconds<br />
Output for 5.3.19, 5.6.18
Func took 3.6180019378662 microseconds<br />
Output for 5.6.17
Func took 3.2980442047119 microseconds<br />
Output for 5.6.16
Func took 3.3938884735107 microseconds<br />
Output for 5.6.15
Func took 3.4370422363281 microseconds<br />
Output for 5.6.14
Func took 3.5521984100342 microseconds<br />
Output for 5.6.13
Func took 3.2749176025391 microseconds<br />
Output for 5.6.12
Func took 3.35693359375 microseconds<br />
Output for 5.5.3, 5.6.11
Func took 3.4780502319336 microseconds<br />
Output for 5.6.10
Func took 4.4481754302979 microseconds<br />
Output for 5.6.9
Func took 3.2229423522949 microseconds<br />
Output for 5.6.8
Func took 3.6270618438721 microseconds<br />
Output for 5.6.7
Func took 3.7679672241211 microseconds<br />
Output for 5.6.6
Func took 3.5321712493896 microseconds<br />
Output for 5.6.5
Func took 3.6020278930664 microseconds<br />
Output for 5.6.4
Func took 3.3948421478271 microseconds<br />
Output for 5.6.3
Func took 3.2339096069336 microseconds<br />
Output for 5.6.2
Func took 3.3700466156006 microseconds<br />
Output for 5.6.1
Func took 3.3440589904785 microseconds<br />
Output for 5.6.0
Func took 3.3390522003174 microseconds<br />
Output for 5.5.38
Func took 3.1790733337402 microseconds<br />
Output for 5.5.37
Func took 3.4840106964111 microseconds<br />
Output for 5.5.14, 5.5.36
Func took 3.8518905639648 microseconds<br />
Output for 5.5.35
Func took 3.5040378570557 microseconds<br />
Output for 5.5.34
Func took 3.5519599914551 microseconds<br />
Output for 5.5.33
Func took 3.5679340362549 microseconds<br />
Output for 5.5.32
Func took 3.309965133667 microseconds<br />
Output for 5.5.31
Func took 3.6828517913818 microseconds<br />
Output for 5.5.30
Func took 3.3988952636719 microseconds<br />
Output for 5.5.29
Func took 3.5660266876221 microseconds<br />
Output for 5.5.28
Func took 3.7219524383545 microseconds<br />
Output for 5.5.27
Func took 5.2359104156494 microseconds<br />
Output for 5.3.29, 5.5.25
Func took 3.9000511169434 microseconds<br />
Output for 5.5.24
Func took 4.4460296630859 microseconds<br />
Output for 5.5.23
Func took 3.2479763031006 microseconds<br />
Output for 5.5.22
Func took 4.533052444458 microseconds<br />
Output for 5.5.21
Func took 3.2539367675781 microseconds<br />
Output for 5.5.20
Func took 4.1670799255371 microseconds<br />
Output for 5.5.19
Func took 4.0149688720703 microseconds<br />
Output for 5.5.18
Func took 3.4089088439941 microseconds<br />
Output for 5.5.17
Func took 3.4389495849609 microseconds<br />
Output for 5.5.16
Func took 3.5688877105713 microseconds<br />
Output for 5.5.15
Func took 4.4112205505371 microseconds<br />
Output for 5.5.13
Func took 3.8740634918213 microseconds<br />
Output for 5.5.12
Func took 3.6520957946777 microseconds<br />
Output for 5.5.11
Func took 4.5249462127686 microseconds<br />
Output for 5.5.10
Func took 3.3280849456787 microseconds<br />
Output for 5.5.9
Func took 4.1120052337646 microseconds<br />
Output for 5.5.8
Func took 3.2029151916504 microseconds<br />
Output for 5.5.7
Func took 4.6041011810303 microseconds<br />
Output for 5.5.6
Func took 3.1769275665283 microseconds<br />
Output for 5.5.5
Func took 3.2289028167725 microseconds<br />
Output for 5.5.4
Func took 3.2169818878174 microseconds<br />
Output for 5.5.2
Func took 3.3800601959229 microseconds<br />
Output for 5.5.1
Func took 3.5650730133057 microseconds<br />
Output for 5.5.0
Func took 3.1569004058838 microseconds<br />
Output for 5.4.45
Func took 16.810894012451 microseconds<br />
Output for 5.4.44
Func took 4.6460628509521 microseconds<br />
Output for 5.4.43
Func took 3.9248466491699 microseconds<br />
Output for 5.4.42
Func took 3.1991004943848 microseconds<br />
Output for 5.4.41
Func took 3.7000179290771 microseconds<br />
Output for 5.4.40
Func took 3.6449432373047 microseconds<br />
Output for 5.4.39
Func took 4.0500164031982 microseconds<br />
Output for 5.4.38
Func took 3.5169124603271 microseconds<br />
Output for 5.4.37
Func took 3.1239986419678 microseconds<br />
Output for 5.4.36
Func took 3.2920837402344 microseconds<br />
Output for 5.4.35
Func took 3.3957958221436 microseconds<br />
Output for 5.4.34
Func took 5.2108764648438 microseconds<br />
Output for 5.4.33
Func took 3.4520626068115 microseconds<br />
Output for 5.4.32
Func took 3.4120082855225 microseconds<br />
Output for 5.4.30
Func took 3.3588409423828 microseconds<br />
Output for 5.4.29
Func took 3.3581256866455 microseconds<br />
Output for 5.4.28
Func took 3.5779476165771 microseconds<br />
Output for 5.3.13, 5.4.27
Func took 4.1360855102539 microseconds<br />
Output for 5.4.26
Func took 3.262996673584 microseconds<br />
Output for 5.4.25
Func took 4.8360824584961 microseconds<br />
Output for 5.4.24
Func took 3.8959980010986 microseconds<br />
Output for 5.4.23
Func took 4.706859588623 microseconds<br />
Output for 5.4.22
Func took 3.3960342407227 microseconds<br />
Output for 5.4.21
Func took 3.4890174865723 microseconds<br />
Output for 5.4.20
Func took 3.3831596374512 microseconds<br />
Output for 5.4.19
Func took 4.5580863952637 microseconds<br />
Output for 5.4.17
Func took 5.1968097686768 microseconds<br />
Output for 5.4.16
Func took 4.5008659362793 microseconds<br />
Output for 5.4.15
Func took 3.7899017333984 microseconds<br />
Output for 5.4.14
Func took 3.3597946166992 microseconds<br />
Output for 5.4.13
Func took 3.1359195709229 microseconds<br />
Output for 5.4.12
Func took 3.2148361206055 microseconds<br />
Output for 5.4.11
Func took 3.1719207763672 microseconds<br />
Output for 5.4.10
Func took 3.9610862731934 microseconds<br />
Output for 5.4.9
Func took 3.3130645751953 microseconds<br />
Output for 5.4.8
Func took 3.4217834472656 microseconds<br />
Output for 5.4.7
Func took 5.5539608001709 microseconds<br />
Output for 5.4.6
Func took 3.4801959991455 microseconds<br />
Output for 5.4.5
Func took 3.7178993225098 microseconds<br />
Output for 5.4.4
Func took 3.3731460571289 microseconds<br />
Output for 5.4.3
Func took 5.1140785217285 microseconds<br />
Output for 5.4.2
Func took 3.7820339202881 microseconds<br />
Output for 5.4.1
Func took 3.3981800079346 microseconds<br />
Output for 5.4.0
Func took 3.3199787139893 microseconds<br />
Output for 5.3.28
Func took 4.3051242828369 microseconds<br />
Output for 5.3.27
Func took 3.4182071685791 microseconds<br />
Output for 5.3.26
Func took 5.3451061248779 microseconds<br />
Output for 5.3.25
Func took 3.31711769104 microseconds<br />
Output for 5.3.24
Func took 3.5421848297119 microseconds<br />
Output for 5.3.23
Func took 3.8301944732666 microseconds<br />
Output for 5.3.22
Func took 3.5150051116943 microseconds<br />
Output for 5.3.21
Func took 3.486156463623 microseconds<br />
Output for 5.3.20
Func took 3.4091472625732 microseconds<br />
Output for 5.3.18
Func took 3.5831928253174 microseconds<br />
Output for 5.3.17
Func took 3.587007522583 microseconds<br />
Output for 5.3.16
Func took 3.4880638122559 microseconds<br />
Output for 5.3.15
Func took 3.6261081695557 microseconds<br />
Output for 5.3.14
Func took 3.8840770721436 microseconds<br />
Output for 5.3.12
Func took 3.5161972045898 microseconds<br />
Output for 5.3.11
Func took 3.413200378418 microseconds<br />
Output for 5.3.10
Func took 3.4761428833008 microseconds<br />
Output for 5.3.9
Func took 3.7980079650879 microseconds<br />
Output for 5.3.8
Func took 3.7360191345215 microseconds<br />
Output for 5.3.7
Func took 3.5431385040283 microseconds<br />
Output for 5.3.6
Func took 3.676176071167 microseconds<br />
Output for 5.3.5
Func took 4.6150684356689 microseconds<br />
Output for 5.3.4
Func took 3.7310123443604 microseconds<br />
Output for 5.3.3
Func took 4.3950080871582 microseconds<br />
Output for 5.3.2
Func took 3.5500526428223 microseconds<br />
Output for 5.3.1
Func took 4.4260025024414 microseconds<br />
Output for 5.3.0
Func took 3.6900043487549 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/pglkZ 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/pglkZ 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/pglkZ 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/pglkZ on line 13
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/pglkZ on line 13
Process exited with code 255.

preferences:
211.31 ms | 401 KiB | 288 Q