3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class Foo { private $spec; private $msg; public function __construct($spec, $msg = null) { $this->spec = $spec; $this->msg = $msg; } public static function new_instance($spec, $msg = null) { return new static($spec, $msg); } } const ITERATIONS = 100000; $time1 = -microtime(true); for ($i = 0; $i < ITERATIONS; ++$i) { Foo::new_instance(array(), 'foo'); } $time1 += microtime(true); echo "direct function call took $time1 seconds\n"; $time2 = -microtime(true); for ($i = 0; $i < ITERATIONS; ++$i) { call_user_func_array(array('Foo', 'new_instance'), array(array(), 'foo')); } $time2 += microtime(true); echo "call_user_func_array() took $time2 seconds\n"; echo "difference: ", $time2 / $time1, "\n";
Output for 7.1.0
direct function call took 0.01172399520874 seconds call_user_func_array() took 0.022742986679077 seconds difference: 1.9398665961687
Output for 7.0.14
direct function call took 0.029693841934204 seconds call_user_func_array() took 0.036960124969482 seconds difference: 1.2447067325063
Output for 7.0.11
direct function call took 0.021996974945068 seconds call_user_func_array() took 0.03063702583313 seconds difference: 1.392783594546
Output for 7.0.10
direct function call took 0.025516033172607 seconds call_user_func_array() took 0.030029058456421 seconds difference: 1.1768701762254
Output for 7.0.9
direct function call took 0.023930788040161 seconds call_user_func_array() took 0.029277086257935 seconds difference: 1.223406693035
Output for 7.0.8
direct function call took 0.019643068313599 seconds call_user_func_array() took 0.027317047119141 seconds difference: 1.3906710847322
Output for 7.0.7
direct function call took 0.025361061096191 seconds call_user_func_array() took 0.035512924194336 seconds difference: 1.4002933102696
Output for 7.0.6
direct function call took 0.021390199661255 seconds call_user_func_array() took 0.02820611000061 seconds difference: 1.3186464103793
Output for 7.0.5
direct function call took 0.023900985717773 seconds call_user_func_array() took 0.034018039703369 seconds difference: 1.4232902402043
Output for 7.0.4
direct function call took 0.023967981338501 seconds call_user_func_array() took 0.033176898956299 seconds difference: 1.3842174894806
Output for 7.0.3
direct function call took 0.019760847091675 seconds call_user_func_array() took 0.026376962661743 seconds difference: 1.3348093095086
Output for 7.0.2
direct function call took 0.022972106933594 seconds call_user_func_array() took 0.031970024108887 seconds difference: 1.3916888077051
Output for 7.0.1
direct function call took 0.024043083190918 seconds call_user_func_array() took 0.032914876937866 seconds difference: 1.3689956764904
Output for 7.0.0
direct function call took 0.022089004516602 seconds call_user_func_array() took 0.026232957839966 seconds difference: 1.1876025386409
Output for 5.6.28
direct function call took 0.06458306312561 seconds call_user_func_array() took 0.11937284469604 seconds difference: 1.8483614576142
Output for 5.6.26
direct function call took 0.041672945022583 seconds call_user_func_array() took 0.085617065429688 seconds difference: 2.0544999971394
Output for 5.6.25
direct function call took 0.03789496421814 seconds call_user_func_array() took 0.09100604057312 seconds difference: 2.401533883216
Output for 5.6.24
direct function call took 0.059376001358032 seconds call_user_func_array() took 0.10675191879272 seconds difference: 1.7978967318634
Output for 5.6.23
direct function call took 0.059629917144775 seconds call_user_func_array() took 0.11120820045471 seconds difference: 1.8649732513414
Output for 5.6.22
direct function call took 0.047614812850952 seconds call_user_func_array() took 0.090451002120972 seconds difference: 1.8996399797708
Output for 5.6.21
direct function call took 0.056777000427246 seconds call_user_func_array() took 0.10059094429016 seconds difference: 1.771684723272
Output for 5.6.20
direct function call took 0.049572944641113 seconds call_user_func_array() took 0.089393138885498 seconds difference: 1.803264654393
Output for 5.6.19
direct function call took 0.051027059555054 seconds call_user_func_array() took 0.087078094482422 seconds difference: 1.7065081790275
Output for 5.6.18
direct function call took 0.044063091278076 seconds call_user_func_array() took 0.086496114730835 seconds difference: 1.9630060493253
Output for 5.6.17
direct function call took 0.050541162490845 seconds call_user_func_array() took 0.085875988006592 seconds difference: 1.6991296554001
Output for 5.6.16
direct function call took 0.056130886077881 seconds call_user_func_array() took 0.10043597221375 seconds difference: 1.7893174191904
Output for 5.6.15
direct function call took 0.04933500289917 seconds call_user_func_array() took 0.088665962219238 seconds difference: 1.7972221953742
Output for 5.6.14
direct function call took 0.053993940353394 seconds call_user_func_array() took 0.09822416305542 seconds difference: 1.8191701219162
Output for 5.6.13
direct function call took 0.052221059799194 seconds call_user_func_array() took 0.091052055358887 seconds difference: 1.7435888070638
Output for 5.6.12
direct function call took 0.050717115402222 seconds call_user_func_array() took 0.09502100944519 seconds difference: 1.8735491695773
Output for 5.6.11
direct function call took 0.049371004104614 seconds call_user_func_array() took 0.088542938232422 seconds difference: 1.7934198389971
Output for 5.6.10
direct function call took 0.054131031036377 seconds call_user_func_array() took 0.091453075408936 seconds difference: 1.6894759559905
Output for 5.6.9
direct function call took 0.055975914001465 seconds call_user_func_array() took 0.099488973617554 seconds difference: 1.7773532668882
Output for 5.6.8
direct function call took 0.042739868164062 seconds call_user_func_array() took 0.10057210922241 seconds difference: 2.3531216529811
Output for 5.6.7
direct function call took 0.053650856018066 seconds call_user_func_array() took 0.10000395774841 seconds difference: 1.8639769273157
Output for 5.6.6
direct function call took 0.04258394241333 seconds call_user_func_array() took 0.08763599395752 seconds difference: 2.0579586809249
Output for 5.6.5
direct function call took 0.046706914901733 seconds call_user_func_array() took 0.087883949279785 seconds difference: 1.8816046716998
Output for 5.6.4
direct function call took 0.046104907989502 seconds call_user_func_array() took 0.089179992675781 seconds difference: 1.9342841481451
Output for 5.6.3
direct function call took 0.044745922088623 seconds call_user_func_array() took 0.086848020553589 seconds difference: 1.9409147582562
Output for 5.6.2
direct function call took 0.054807901382446 seconds call_user_func_array() took 0.087337017059326 seconds difference: 1.5935114254767
Output for 5.6.1
direct function call took 0.054008007049561 seconds call_user_func_array() took 0.11181616783142 seconds difference: 2.070362783963
Output for 5.6.0
direct function call took 0.056536912918091 seconds call_user_func_array() took 0.094345092773438 seconds difference: 1.6687344232983
Output for 5.5.38
direct function call took 0.048057079315186 seconds call_user_func_array() took 0.090246915817261 seconds difference: 1.8779109572051
Output for 5.5.37
direct function call took 0.046092987060547 seconds call_user_func_array() took 0.08778715133667 seconds difference: 1.9045663328644
Output for 5.5.36
direct function call took 0.039293050765991 seconds call_user_func_array() took 0.086665153503418 seconds difference: 2.2056101985959
Output for 5.5.35
direct function call took 0.055152893066406 seconds call_user_func_array() took 0.095267057418823 seconds difference: 1.7273265666067
Output for 5.5.34
direct function call took 0.045133113861084 seconds call_user_func_array() took 0.088736057281494 seconds difference: 1.9660965018859
Output for 5.5.33
direct function call took 0.047286033630371 seconds call_user_func_array() took 0.09015679359436 seconds difference: 1.9066262630337
Output for 5.5.32
direct function call took 0.052721977233887 seconds call_user_func_array() took 0.0971999168396 seconds difference: 1.8436318578948
Output for 5.5.31
direct function call took 0.04896092414856 seconds call_user_func_array() took 0.091582059860229 seconds difference: 1.8705133012266
Output for 5.5.30
direct function call took 0.041840791702271 seconds call_user_func_array() took 0.088166952133179 seconds difference: 2.1072008570142
Output for 5.5.29
direct function call took 0.056265115737915 seconds call_user_func_array() took 0.10115218162537 seconds difference: 1.797777900192
Output for 5.5.28
direct function call took 0.047265768051147 seconds call_user_func_array() took 0.090580940246582 seconds difference: 1.9164173984978
Output for 5.5.27
direct function call took 0.059677124023438 seconds call_user_func_array() took 0.1054048538208 seconds difference: 1.7662522372795
Output for 5.5.26
direct function call took 0.046088933944702 seconds call_user_func_array() took 0.09041690826416 seconds difference: 1.9617921380573
Output for 5.5.25
direct function call took 0.051548957824707 seconds call_user_func_array() took 0.091520071029663 seconds difference: 1.7754009953194
Output for 5.5.24
direct function call took 0.052315950393677 seconds call_user_func_array() took 0.096709012985229 seconds difference: 1.8485569364122
Output for 5.5.23
direct function call took 0.044116973876953 seconds call_user_func_array() took 0.089980840682983 seconds difference: 2.0395968439256
Output for 5.5.22
direct function call took 0.049278974533081 seconds call_user_func_array() took 0.0882408618927 seconds difference: 1.7906391666788
Output for 5.5.21
direct function call took 0.046838998794556 seconds call_user_func_array() took 0.091187000274658 seconds difference: 1.9468178787216
Output for 5.5.20
direct function call took 0.051199197769165 seconds call_user_func_array() took 0.089655876159668 seconds difference: 1.7511187687723
Output for 5.5.19
direct function call took 0.052515983581543 seconds call_user_func_array() took 0.08730411529541 seconds difference: 1.6624294041804
Output for 5.5.18
direct function call took 0.055695056915283 seconds call_user_func_array() took 0.10220789909363 seconds difference: 1.8351341170024
Output for 5.5.16
direct function call took 0.049072027206421 seconds call_user_func_array() took 0.11235380172729 seconds difference: 2.2895691929473
Output for 5.5.15
direct function call took 0.046648025512695 seconds call_user_func_array() took 0.088915824890137 seconds difference: 1.9061005029235
Output for 5.5.14
direct function call took 0.063612937927246 seconds call_user_func_array() took 0.097784996032715 seconds difference: 1.537187232958
Output for 5.5.13
direct function call took 0.059463024139404 seconds call_user_func_array() took 0.10475611686707 seconds difference: 1.7617018034851
Output for 5.5.12
direct function call took 0.052635192871094 seconds call_user_func_array() took 0.089619874954224 seconds difference: 1.7026607116973
Output for 5.5.11
direct function call took 0.047406911849976 seconds call_user_func_array() took 0.087982177734375 seconds difference: 1.8558934615443
Output for 5.5.10
direct function call took 0.04930591583252 seconds call_user_func_array() took 0.090673923492432 seconds difference: 1.8390069824568
Output for 5.5.9
direct function call took 0.049251079559326 seconds call_user_func_array() took 0.092391967773438 seconds difference: 1.8759379205515
Output for 5.5.8
direct function call took 0.040772914886475 seconds call_user_func_array() took 0.087907075881958 seconds difference: 2.1560164664881
Output for 5.5.7
direct function call took 0.038655996322632 seconds call_user_func_array() took 0.093092918395996 seconds difference: 2.4082400468745
Output for 5.5.6
direct function call took 0.038265943527222 seconds call_user_func_array() took 0.087779998779297 seconds difference: 2.2939457566714
Output for 5.5.5
direct function call took 0.056694030761719 seconds call_user_func_array() took 0.096966028213501 seconds difference: 1.7103392881173
Output for 5.5.4
direct function call took 0.057369947433472 seconds call_user_func_array() took 0.101243019104 seconds difference: 1.7647396177486
Output for 5.5.3
direct function call took 0.053725957870483 seconds call_user_func_array() took 0.097851991653442 seconds difference: 1.8213168369996
Output for 5.5.2
direct function call took 0.03898286819458 seconds call_user_func_array() took 0.087234973907471 seconds difference: 2.2377772069527
Output for 5.5.1
direct function call took 0.060128927230835 seconds call_user_func_array() took 0.10467600822449 seconds difference: 1.7408594007113
Output for 5.5.0
direct function call took 0.050656080245972 seconds call_user_func_array() took 0.094980001449585 seconds difference: 1.8749970583667
Output for 5.4.45
direct function call took 0.058109045028687 seconds call_user_func_array() took 0.1011209487915 seconds difference: 1.7401929207679
Output for 5.4.44
direct function call took 0.050333023071289 seconds call_user_func_array() took 0.090950012207031 seconds difference: 1.8069650233052
Output for 5.4.43
direct function call took 0.04635214805603 seconds call_user_func_array() took 0.090042114257812 seconds difference: 1.9425661600185
Output for 5.4.42
direct function call took 0.071343898773193 seconds call_user_func_array() took 0.098936796188354 seconds difference: 1.3867590346146
Output for 5.4.41
direct function call took 0.048279047012329 seconds call_user_func_array() took 0.090266942977905 seconds difference: 1.8696918966701
Output for 5.4.40
direct function call took 0.044003009796143 seconds call_user_func_array() took 0.08713698387146 seconds difference: 1.9802505391142
Output for 5.4.39
direct function call took 0.048088073730469 seconds call_user_func_array() took 0.086328983306885 seconds difference: 1.7952264794542
Output for 5.4.38
direct function call took 0.051447153091431 seconds call_user_func_array() took 0.08675217628479 seconds difference: 1.6862386171421
Output for 5.4.37
direct function call took 0.044641017913818 seconds call_user_func_array() took 0.087406158447266 seconds difference: 1.957978615452
Output for 5.4.36
direct function call took 0.047876119613647 seconds call_user_func_array() took 0.087274074554443 seconds difference: 1.8229145398318
Output for 5.4.35
direct function call took 0.057171821594238 seconds call_user_func_array() took 0.10122203826904 seconds difference: 1.7704882483444
Output for 5.4.34
direct function call took 0.049951791763306 seconds call_user_func_array() took 0.090145111083984 seconds difference: 1.8046421940405
Output for 5.4.32
direct function call took 0.046587944030762 seconds call_user_func_array() took 0.086730003356934 seconds difference: 1.8616404986592
Output for 5.4.31
direct function call took 0.049580097198486 seconds call_user_func_array() took 0.094151020050049 seconds difference: 1.8989680410091
Output for 5.4.30
direct function call took 0.048964977264404 seconds call_user_func_array() took 0.089607000350952 seconds difference: 1.8300223007781
Output for 5.4.29
direct function call took 0.041279077529907 seconds call_user_func_array() took 0.088279008865356 seconds difference: 2.1385896717628
Output for 5.4.28
direct function call took 0.054693937301636 seconds call_user_func_array() took 0.092918872833252 seconds difference: 1.6988879831563
Output for 5.4.27
direct function call took 0.053224802017212 seconds call_user_func_array() took 0.095194816589355 seconds difference: 1.7885424272423
Output for 5.4.26
direct function call took 0.041558980941772 seconds call_user_func_array() took 0.085936069488525 seconds difference: 2.067809834147
Output for 5.4.25
direct function call took 0.05610203742981 seconds call_user_func_array() took 0.091366052627563 seconds difference: 1.6285692429954
Output for 5.4.24
direct function call took 0.045999050140381 seconds call_user_func_array() took 0.089338064193726 seconds difference: 1.9421719344439
Output for 5.4.23
direct function call took 0.038342952728271 seconds call_user_func_array() took 0.086678981781006 seconds difference: 2.2606235465297
Output for 5.4.22
direct function call took 0.037976026535034 seconds call_user_func_array() took 0.085366010665894 seconds difference: 2.2478921165473
Output for 5.4.21
direct function call took 0.047987937927246 seconds call_user_func_array() took 0.087214946746826 seconds difference: 1.8174347661917
Output for 5.4.20
direct function call took 0.047672986984253 seconds call_user_func_array() took 0.091261148452759 seconds difference: 1.9143157210372
Output for 5.4.19
direct function call took 0.047674894332886 seconds call_user_func_array() took 0.087846040725708 seconds difference: 1.8426058820882
Output for 5.4.18
direct function call took 0.039106845855713 seconds call_user_func_array() took 0.088572978973389 seconds difference: 2.2648970285199
Output for 5.4.17
direct function call took 0.038547039031982 seconds call_user_func_array() took 0.08686900138855 seconds difference: 2.253584284813
Output for 5.4.16
direct function call took 0.037832021713257 seconds call_user_func_array() took 0.086615085601807 seconds difference: 2.2894648945355
Output for 5.4.15
direct function call took 0.038056135177612 seconds call_user_func_array() took 0.086968898773193 seconds difference: 2.285279321384
Output for 5.4.14
direct function call took 0.043850898742676 seconds call_user_func_array() took 0.08792781829834 seconds difference: 2.0051543028642
Output for 5.4.13
direct function call took 0.038500070571899 seconds call_user_func_array() took 0.09096884727478 seconds difference: 2.3628228708021
Output for 5.4.12
direct function call took 0.039886951446533 seconds call_user_func_array() took 0.088443040847778 seconds difference: 2.2173427058303
Output for 5.4.11
direct function call took 0.038270950317383 seconds call_user_func_array() took 0.08597993850708 seconds difference: 2.2466110142038
Output for 5.4.10
direct function call took 0.049164056777954 seconds call_user_func_array() took 0.088670015335083 seconds difference: 1.8035536761247
Output for 5.4.9
direct function call took 0.049238920211792 seconds call_user_func_array() took 0.11026191711426 seconds difference: 2.2393244335982
Output for 5.4.8
direct function call took 0.055522918701172 seconds call_user_func_array() took 0.10168695449829 seconds difference: 1.8314410855376
Output for 5.4.7
direct function call took 0.044657945632935 seconds call_user_func_array() took 0.088057041168213 seconds difference: 1.9718112850958
Output for 5.4.6
direct function call took 0.052374124526978 seconds call_user_func_array() took 0.096901178359985 seconds difference: 1.8501727567794
Output for 5.4.5
direct function call took 0.045236825942993 seconds call_user_func_array() took 0.087741851806641 seconds difference: 1.9396111459547
Output for 5.4.4
direct function call took 0.047557830810547 seconds call_user_func_array() took 0.088377952575684 seconds difference: 1.8583259805888
Output for 5.4.3
direct function call took 0.04849100112915 seconds call_user_func_array() took 0.087228059768677 seconds difference: 1.7988504616837
Output for 5.4.2
direct function call took 0.050987958908081 seconds call_user_func_array() took 0.094037055969238 seconds difference: 1.8442992813022
Output for 5.4.1
direct function call took 0.061537027359009 seconds call_user_func_array() took 0.11087799072266 seconds difference: 1.8018093411596
Output for 5.4.0
direct function call took 0.060970783233643 seconds call_user_func_array() took 0.092001914978027 seconds difference: 1.508950846596
Output for 5.3.29
direct function call took 0.072281122207642 seconds call_user_func_array() took 0.13873696327209 seconds difference: 1.9194079869644
Output for 5.3.28
direct function call took 0.064634084701538 seconds call_user_func_array() took 0.11464095115662 seconds difference: 1.7736918792305
Output for 5.3.27
direct function call took 0.067476034164429 seconds call_user_func_array() took 0.10968613624573 seconds difference: 1.6255569492783
Output for 5.3.26
direct function call took 0.10031294822693 seconds call_user_func_array() took 0.11790800094604 seconds difference: 1.1754016109597
Output for 5.3.25
direct function call took 0.070718050003052 seconds call_user_func_array() took 0.11407113075256 seconds difference: 1.6130412355494
Output for 5.3.24
direct function call took 0.065146923065186 seconds call_user_func_array() took 0.10465002059937 seconds difference: 1.6063693521589
Output for 5.3.23
direct function call took 0.075262784957886 seconds call_user_func_array() took 0.1090259552002 seconds difference: 1.4486037855389
Output for 5.3.22
direct function call took 0.070544958114624 seconds call_user_func_array() took 0.11363196372986 seconds difference: 1.6107737075302
Output for 5.3.21
direct function call took 0.077016115188599 seconds call_user_func_array() took 0.12042903900146 seconds difference: 1.5636862325054
Output for 5.3.20
direct function call took 0.097357034683228 seconds call_user_func_array() took 0.11809086799622 seconds difference: 1.2129669764537
Output for 5.3.19
direct function call took 0.089035034179688 seconds call_user_func_array() took 0.11307597160339 seconds difference: 1.2700166023993
Output for 5.3.18
direct function call took 0.096144914627075 seconds call_user_func_array() took 0.11526393890381 seconds difference: 1.1988563238201
Output for 5.3.17
direct function call took 0.091912031173706 seconds call_user_func_array() took 0.11333990097046 seconds difference: 1.233134547492
Output for 5.3.16
direct function call took 0.067728996276855 seconds call_user_func_array() took 0.10833597183228 seconds difference: 1.5995508244273
Output for 5.3.15
direct function call took 0.088203907012939 seconds call_user_func_array() took 0.10930109024048 seconds difference: 1.2391864934559
Output for 5.3.14
direct function call took 0.073109865188599 seconds call_user_func_array() took 0.11101412773132 seconds difference: 1.5184561952747
Output for 5.3.13
direct function call took 0.077955961227417 seconds call_user_func_array() took 0.1102249622345 seconds difference: 1.4139388508461
Output for 5.3.12
direct function call took 0.099690914154053 seconds call_user_func_array() took 0.11833190917969 seconds difference: 1.1869879033994
Output for 5.3.11
direct function call took 0.088567018508911 seconds call_user_func_array() took 0.11283016204834 seconds difference: 1.2739523577503
Output for 5.3.10
direct function call took 0.087805032730103 seconds call_user_func_array() took 0.11648511886597 seconds difference: 1.3266337389113
Output for 5.3.9
direct function call took 0.10355997085571 seconds call_user_func_array() took 0.11251211166382 seconds difference: 1.0864440259507
Output for 5.3.8
direct function call took 0.097717046737671 seconds call_user_func_array() took 0.11998915672302 seconds difference: 1.2279245098876
Output for 5.3.7
direct function call took 0.10955500602722 seconds call_user_func_array() took 0.12326121330261 seconds difference: 1.1251079961785
Output for 5.3.6
direct function call took 0.099769830703735 seconds call_user_func_array() took 0.1192741394043 seconds difference: 1.1954930519876
Output for 5.3.5
direct function call took 0.080678939819336 seconds call_user_func_array() took 0.11098408699036 seconds difference: 1.3756264923521
Output for 5.3.4
direct function call took 0.094573974609375 seconds call_user_func_array() took 0.111328125 seconds difference: 1.1771539206196
Output for 5.3.3
direct function call took 0.081198930740356 seconds call_user_func_array() took 0.11114311218262 seconds difference: 1.3687755635356
Output for 5.3.2
direct function call took 0.075221061706543 seconds call_user_func_array() took 0.11216998100281 seconds difference: 1.491204437401
Output for 5.3.1
direct function call took 0.089911937713623 seconds call_user_func_array() took 0.11214303970337 seconds difference: 1.2472541750858
Output for 5.3.0
direct function call took 0.081459999084473 seconds call_user_func_array() took 0.11066198348999 seconds difference: 1.3584825034829
Output for 5.1.0 - 5.2.17
Parse error: syntax error, unexpected T_STATIC, expecting T_STRING or T_VARIABLE or '$' in /in/XH4En on line 13
Process exited with code 255.
Output for 5.0.0 - 5.0.5
Parse error: parse error, unexpected T_STATIC, expecting T_STRING or T_VARIABLE or '$' in /in/XH4En on line 13
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/XH4En on line 4
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_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/XH4En on line 4
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `T_OLD_FUNCTION' or `T_FUNCTION' or `T_VAR' or `'}'' in /in/XH4En on line 4
Process exited with code 255.