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 = 1000000; $time1 = -microtime(true); for ($i = 0; $i < ITERATIONS; ++$i) { Foo::new_instance([], '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(['Foo', 'new_instance'], [[], '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.11629319190979 seconds call_user_func_array() took 0.22590804100037 seconds difference: 1.9425732262608
Output for 7.0.14
direct function call took 0.002863883972168 seconds call_user_func_array() took -0.23968482017517 seconds difference: -83.692224442224
Output for 7.0.10
direct function call took 0.13638091087341 seconds call_user_func_array() took 0.20473313331604 seconds difference: 1.5011861411167
Output for 7.0.9
direct function call took 0.17827486991882 seconds call_user_func_array() took 0.25970911979675 seconds difference: 1.4567904041383
Output for 7.0.8
direct function call took 0.19139409065247 seconds call_user_func_array() took 0.25219702720642 seconds difference: 1.3176845029367
Output for 7.0.7
direct function call took 0.14061617851257 seconds call_user_func_array() took 0.20588421821594 seconds difference: 1.4641573991967
Output for 7.0.6
direct function call took 0.2023458480835 seconds call_user_func_array() took 0.25322604179382 seconds difference: 1.2514516319076
Output for 7.0.5
direct function call took 0.1926281452179 seconds call_user_func_array() took 0.26581501960754 seconds difference: 1.3799386341329
Output for 7.0.4
direct function call took 0.20587801933289 seconds call_user_func_array() took 0.2664110660553 seconds difference: 1.2940238444034
Output for 7.0.3
direct function call took 0.18317198753357 seconds call_user_func_array() took 0.25730490684509 seconds difference: 1.4047175570333
Output for 7.0.2
direct function call took 0.18540716171265 seconds call_user_func_array() took 0.25344514846802 seconds difference: 1.3669652570423
Output for 7.0.1
direct function call took 0.17175602912903 seconds call_user_func_array() took 0.2543580532074 seconds difference: 1.4809264891442
Output for 7.0.0
direct function call took 0.16352200508118 seconds call_user_func_array() took 0.24900603294373 seconds difference: 1.5227677328205
Output for hhvm-3.12.0
direct function call took 0.70429801940918 seconds call_user_func_array() took 0.67618298530579 seconds difference: 0.96008077074109
Output for hhvm-3.10.0
direct function call took 0.75927805900574 seconds call_user_func_array() took 1.2623560428619 seconds difference: 1.6625741095627
Output for 5.6.28
direct function call took 0.046130180358887 seconds call_user_func_array() took 1.0936329364777 seconds difference: 23.707536540489
Output for 5.6.25
direct function call took 0.3658390045166 seconds call_user_func_array() took 0.79991292953491 seconds difference: 2.1865162534866
Output for 5.6.24
direct function call took 0.39425206184387 seconds call_user_func_array() took 0.83477902412415 seconds difference: 2.1173738958269
Output for 5.6.23
direct function call took 0.41158103942871 seconds call_user_func_array() took 0.85351800918579 seconds difference: 2.0737544430387
Output for 5.6.22
direct function call took 0.40309500694275 seconds call_user_func_array() took 0.95841884613037 seconds difference: 2.3776500071272
Output for 5.6.21
direct function call took 0.39577317237854 seconds call_user_func_array() took 0.83106184005737 seconds difference: 2.099843794522
Output for 5.6.20
direct function call took 0.39044594764709 seconds call_user_func_array() took 0.81683397293091 seconds difference: 2.0920539138729
Output for 5.6.19
direct function call took 0.38551187515259 seconds call_user_func_array() took 0.8118109703064 seconds difference: 2.1058001650016
Output for 5.6.18
direct function call took 0.40968608856201 seconds call_user_func_array() took 0.84987688064575 seconds difference: 2.0744587243096
Output for 5.6.17
direct function call took 0.38351106643677 seconds call_user_func_array() took 0.75343608856201 seconds difference: 1.9645745703305
Output for 5.6.16
direct function call took 0.40287208557129 seconds call_user_func_array() took 0.85118699073792 seconds difference: 2.1127971413827
Output for 5.6.15
direct function call took 0.37845706939697 seconds call_user_func_array() took 0.76630687713623 seconds difference: 2.0248185041364
Output for 5.6.14
direct function call took 0.33292102813721 seconds call_user_func_array() took 0.7658519744873 seconds difference: 2.3004013257212
Output for 5.6.13
direct function call took 0.43853187561035 seconds call_user_func_array() took 0.78599405288696 seconds difference: 1.792330493178
Output for 5.6.12
direct function call took 0.39811611175537 seconds call_user_func_array() took 0.81314992904663 seconds difference: 2.0424944005941
Output for 5.6.11
direct function call took 0.40480494499207 seconds call_user_func_array() took 0.86039400100708 seconds difference: 2.1254532871972
Output for 5.6.10
direct function call took 0.38124895095825 seconds call_user_func_array() took 0.77391505241394 seconds difference: 2.0299467066565
Output for 5.6.9
direct function call took 0.44251012802124 seconds call_user_func_array() took 0.75909996032715 seconds difference: 1.7154408730069
Output for 5.6.8
direct function call took 0.39553308486938 seconds call_user_func_array() took 0.81911611557007 seconds difference: 2.0709168130412
Output for 5.6.7
direct function call took 0.41508007049561 seconds call_user_func_array() took 0.78937101364136 seconds difference: 1.9017319060846
Output for 5.6.6
direct function call took 0.38858389854431 seconds call_user_func_array() took 0.84383797645569 seconds difference: 2.1715721614221
Output for 5.6.5
direct function call took 0.42699503898621 seconds call_user_func_array() took 0.86164402961731 seconds difference: 2.017925153564
Output for 5.6.4
direct function call took 0.39843201637268 seconds call_user_func_array() took 0.84579014778137 seconds difference: 2.1227966454138
Output for 5.6.3
direct function call took 0.41112995147705 seconds call_user_func_array() took 1.0211820602417 seconds difference: 2.4838425334202
Output for 5.6.2
direct function call took 0.3816089630127 seconds call_user_func_array() took 0.76896810531616 seconds difference: 2.0150682500887
Output for 5.6.1
direct function call took 0.36798095703125 seconds call_user_func_array() took 1.0040109157562 seconds difference: 2.7284317206419
Output for 5.6.0
direct function call took 0.41921901702881 seconds call_user_func_array() took 0.86265587806702 seconds difference: 2.0577689537584
Output for 5.5.38
direct function call took 0.39970588684082 seconds call_user_func_array() took 0.85406088829041 seconds difference: 2.1367233168385
Output for 5.5.37
direct function call took 0.391117811203 seconds call_user_func_array() took 0.84049797058105 seconds difference: 2.148963679245
Output for 5.5.36
direct function call took 0.38659310340881 seconds call_user_func_array() took 0.83825707435608 seconds difference: 2.1683187490017
Output for 5.5.35
direct function call took 0.48380184173584 seconds call_user_func_array() took 0.94970011711121 seconds difference: 1.9629940094973
Output for 5.5.34
direct function call took 0.36907911300659 seconds call_user_func_array() took 0.7768120765686 seconds difference: 2.1047305284781
Output for 5.5.33
direct function call took 0.43578720092773 seconds call_user_func_array() took 0.89229702949524 seconds difference: 2.047552171325
Output for 5.5.32
direct function call took 0.41752004623413 seconds call_user_func_array() took 0.8806300163269 seconds difference: 2.1091921795608
Output for 5.5.31
direct function call took 0.39690494537354 seconds call_user_func_array() took 0.84817504882812 seconds difference: 2.136972740488
Output for 5.5.30
direct function call took 0.40842795372009 seconds call_user_func_array() took 0.87071990966797 seconds difference: 2.1318812822119
Output for 5.5.29
direct function call took 0.4173641204834 seconds call_user_func_array() took 0.88164305686951 seconds difference: 2.1124074006371
Output for 5.5.28
direct function call took 0.33788394927979 seconds call_user_func_array() took 0.82800102233887 seconds difference: 2.4505485510744
Output for 5.5.27
direct function call took 0.39372992515564 seconds call_user_func_array() took 0.86567211151123 seconds difference: 2.1986444417935
Output for 5.5.26
direct function call took 0.39461398124695 seconds call_user_func_array() took 0.98762392997742 seconds difference: 2.5027596002975
Output for 5.5.25
direct function call took 0.45143818855286 seconds call_user_func_array() took 0.7848539352417 seconds difference: 1.7385634515273
Output for 5.5.24
direct function call took 0.31727409362793 seconds call_user_func_array() took 0.76879501342773 seconds difference: 2.4231257101291
Output for 5.5.23
direct function call took 0.38668012619019 seconds call_user_func_array() took 0.81584811210632 seconds difference: 2.1098785710674
Output for 5.5.22
direct function call took 0.34360694885254 seconds call_user_func_array() took 0.78426384925842 seconds difference: 2.2824446708003
Output for 5.5.21
direct function call took 0.45639395713806 seconds call_user_func_array() took 0.91194009780884 seconds difference: 1.9981423582543
Output for 5.5.20
direct function call took 0.4550929069519 seconds call_user_func_array() took 0.86358094215393 seconds difference: 1.8975926211155
Output for 5.5.19
direct function call took 0.39885592460632 seconds call_user_func_array() took 0.85114479064941 seconds difference: 2.1339655202302
Output for 5.5.18
direct function call took 0.39833688735962 seconds call_user_func_array() took 0.83645415306091 seconds difference: 2.0998661675683
Output for 5.5.16
direct function call took 0.3235502243042 seconds call_user_func_array() took 0.77754688262939 seconds difference: 2.4031721328629
Output for 5.5.15
direct function call took 0.39044404029846 seconds call_user_func_array() took 0.81053805351257 seconds difference: 2.0759391099759
Output for 5.5.14
direct function call took 0.40958309173584 seconds call_user_func_array() took 0.84524011611938 seconds difference: 2.0636596899965
Output for 5.5.13
direct function call took 0.38513994216919 seconds call_user_func_array() took 0.78894090652466 seconds difference: 2.0484525756565
Output for 5.5.12
direct function call took 0.40119194984436 seconds call_user_func_array() took 0.84302997589111 seconds difference: 2.1013132896065
Output for 5.5.11
direct function call took 0.39302396774292 seconds call_user_func_array() took 0.85556292533875 seconds difference: 2.1768721389999
Output for 5.5.10
direct function call took 0.37886500358582 seconds call_user_func_array() took 0.99667119979858 seconds difference: 2.6306763368626
Output for 5.5.9
direct function call took 0.33526301383972 seconds call_user_func_array() took 0.77359199523926 seconds difference: 2.3074182456914
Output for 5.5.8
direct function call took 0.41519808769226 seconds call_user_func_array() took 0.83996796607971 seconds difference: 2.0230535519766
Output for 5.5.7
direct function call took 0.4561140537262 seconds call_user_func_array() took 0.80108904838562 seconds difference: 1.7563349382488
Output for 5.5.6
direct function call took 0.3986029624939 seconds call_user_func_array() took 0.85307002067566 seconds difference: 2.1401497252764
Output for 5.5.5
direct function call took 0.37125492095947 seconds call_user_func_array() took 0.76991295814514 seconds difference: 2.0738121292921
Output for 5.5.4
direct function call took 0.39452385902405 seconds call_user_func_array() took 0.8324408531189 seconds difference: 2.1099886206582
Output for 5.5.3
direct function call took 0.4087860584259 seconds call_user_func_array() took 0.77310109138489 seconds difference: 1.8912119810588
Output for 5.5.2
direct function call took 0.39970898628235 seconds call_user_func_array() took 0.85447192192078 seconds difference: 2.1377350803847
Output for 5.5.1
direct function call took 0.39231991767883 seconds call_user_func_array() took 0.96958899497986 seconds difference: 2.4714243434706
Output for 5.5.0
direct function call took 0.38143181800842 seconds call_user_func_array() took 0.81159496307373 seconds difference: 2.1277589460453
Output for 5.4.45
direct function call took 0.4037778377533 seconds call_user_func_array() took 0.84273600578308 seconds difference: 2.0871279376606
Output for 5.4.44
direct function call took 0.45634412765503 seconds call_user_func_array() took 1.0035769939423 seconds difference: 2.1991671046568
Output for 5.4.43
direct function call took 0.38975310325623 seconds call_user_func_array() took 0.78379583358765 seconds difference: 2.0110060113425
Output for 5.4.42
direct function call took 0.37040209770203 seconds call_user_func_array() took 0.77728891372681 seconds difference: 2.0985003015617
Output for 5.4.41
direct function call took 0.4109570980072 seconds call_user_func_array() took 0.8528151512146 seconds difference: 2.0751926547808
Output for 5.4.40
direct function call took 0.39123487472534 seconds call_user_func_array() took 0.81428098678589 seconds difference: 2.0813098202392
Output for 5.4.39
direct function call took 0.38649296760559 seconds call_user_func_array() took 0.92187809944153 seconds difference: 2.3852389996971
Output for 5.4.38
direct function call took 0.41535902023315 seconds call_user_func_array() took 0.85616397857666 seconds difference: 2.0612625147663
Output for 5.4.37
direct function call took 0.40934896469116 seconds call_user_func_array() took 0.84248113632202 seconds difference: 2.0581000783956
Output for 5.4.36
direct function call took 0.39634919166565 seconds call_user_func_array() took 0.81504702568054 seconds difference: 2.0563862442997
Output for 5.4.35
direct function call took 0.39961004257202 seconds call_user_func_array() took 0.83110690116882 seconds difference: 2.0797948315301
Output for 5.4.34
direct function call took 0.41685104370117 seconds call_user_func_array() took 0.85802602767944 seconds difference: 2.0583516357813
Output for 5.4.32
direct function call took 0.38679313659668 seconds call_user_func_array() took 0.7589259147644 seconds difference: 1.9620976769186
Output for 5.4.31
direct function call took 0.44317698478699 seconds call_user_func_array() took 0.86369800567627 seconds difference: 1.9488782931528
Output for 5.4.30
direct function call took 0.3260669708252 seconds call_user_func_array() took 0.77165794372559 seconds difference: 2.3665627394664
Output for 5.4.29
direct function call took 0.39437699317932 seconds call_user_func_array() took 0.83281087875366 seconds difference: 2.1117126332341
Output for 5.4.28
direct function call took 0.35438513755798 seconds call_user_func_array() took 0.76121091842651 seconds difference: 2.1479764181757
Output for 5.4.27
direct function call took 0.39274978637695 seconds call_user_func_array() took 0.82801413536072 seconds difference: 2.1082484678069
Output for 5.4.26
direct function call took 0.36752605438232 seconds call_user_func_array() took 0.7647819519043 seconds difference: 2.0808917974254
Output for 5.4.25
direct function call took 0.42706608772278 seconds call_user_func_array() took 0.87743210792542 seconds difference: 2.054558142521
Output for 5.4.24
direct function call took 0.32189393043518 seconds call_user_func_array() took 0.76136493682861 seconds difference: 2.3652665205563
Output for 5.4.23
direct function call took 0.39141893386841 seconds call_user_func_array() took 0.97471117973328 seconds difference: 2.4901993628672
Output for 5.4.22
direct function call took 0.31853008270264 seconds call_user_func_array() took 0.7556619644165 seconds difference: 2.3723409669973
Output for 5.4.21
direct function call took 0.43574190139771 seconds call_user_func_array() took 0.90288019180298 seconds difference: 2.072052719527
Output for 5.4.20
direct function call took 0.40274691581726 seconds call_user_func_array() took 0.85419392585754 seconds difference: 2.1209198439775
Output for 5.4.19
direct function call took 0.3318178653717 seconds call_user_func_array() took 0.77499413490295 seconds difference: 2.3356009901239
Output for 5.4.18
direct function call took 0.38750696182251 seconds call_user_func_array() took 0.82815194129944 seconds difference: 2.1371279045014
Output for 5.4.17
direct function call took 0.41417503356934 seconds call_user_func_array() took 0.85061192512512 seconds difference: 2.0537498791141
Output for 5.4.16
direct function call took 0.39879989624023 seconds call_user_func_array() took 0.84043312072754 seconds difference: 2.1074055651741
Output for 5.4.15
direct function call took 0.3548481464386 seconds call_user_func_array() took 0.75451683998108 seconds difference: 2.1263090918009
Output for 5.4.14
direct function call took 0.42028999328613 seconds call_user_func_array() took 0.84210300445557 seconds difference: 2.0036237310134
Output for 5.4.13
direct function call took 0.32476902008057 seconds call_user_func_array() took 0.76974606513977 seconds difference: 2.3701339030084
Output for 5.4.12
direct function call took 0.40618014335632 seconds call_user_func_array() took 0.82650589942932 seconds difference: 2.0348259582553
Output for 5.4.11
direct function call took 0.34473395347595 seconds call_user_func_array() took 0.86098003387451 seconds difference: 2.4975202622
Output for 5.4.10
direct function call took 0.43389391899109 seconds call_user_func_array() took 0.87974882125854 seconds difference: 2.0275666073039
Output for 5.4.9
direct function call took 0.42319917678833 seconds call_user_func_array() took 0.97113013267517 seconds difference: 2.2947354010589
Output for 5.4.8
direct function call took 0.38927602767944 seconds call_user_func_array() took 0.85166501998901 seconds difference: 2.1878177936257
Output for 5.4.7
direct function call took 0.40538692474365 seconds call_user_func_array() took 0.86378002166748 seconds difference: 2.1307545185718
Output for 5.4.6
direct function call took 0.39203310012817 seconds call_user_func_array() took 0.83228898048401 seconds difference: 2.1230069099061
Output for 5.4.5
direct function call took 0.4157018661499 seconds call_user_func_array() took 0.86517691612244 seconds difference: 2.0812437628328
Output for 5.4.4
direct function call took 0.39287519454956 seconds call_user_func_array() took 0.83035492897034 seconds difference: 2.1135336119206
Output for 5.4.3
direct function call took 0.39223003387451 seconds call_user_func_array() took 0.82329607009888 seconds difference: 2.099013331453
Output for 5.4.2
direct function call took 0.38452506065369 seconds call_user_func_array() took 0.82804107666016 seconds difference: 2.1534125116644
Output for 5.4.1
direct function call took 0.34104299545288 seconds call_user_func_array() took 0.76791310310364 seconds difference: 2.2516606801553
Output for 5.4.0
direct function call took 0.40580105781555 seconds call_user_func_array() took 0.96793413162231 seconds difference: 2.385242997721
Output for 5.3.0 - 5.3.29
Parse error: syntax error, unexpected '[', expecting ')' in /in/41b8T on line 21
Process exited with code 255.
Output for 5.1.0 - 5.2.17
Parse error: syntax error, unexpected T_STATIC, expecting T_STRING or T_VARIABLE or '$' in /in/41b8T 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/41b8T 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/41b8T 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/41b8T 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/41b8T on line 4
Process exited with code 255.