3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class Foo { public function bar() {} } $foo = new Foo(); $method = 'bar'; $args = array(); $iterations = 100000; $start = microtime(true); for($i = 0; $i < $iterations; $i++) { $foo->{$method}($args); } echo 'Calling directly on object: ' . (microtime(true) - $start) . PHP_EOL; $start = microtime(true); for($i = 0; $i < $iterations; $i++) { call_user_func(array($foo, $method), $args); } echo 'Calling call_user_func: ' . (microtime(true) - $start) . PHP_EOL;
Output for 7.1.0
Calling directly on object: 0.0097250938415527 Calling call_user_func: 0.018371105194092
Output for 7.0.14
Calling directly on object: 0.013295888900757 Calling call_user_func: 0.02043080329895
Output for 7.0.8
Calling directly on object: 0.0050079822540283 Calling call_user_func: 0.010494947433472
Output for 7.0.7
Calling directly on object: 0.0073180198669434 Calling call_user_func: 0.014096975326538
Output for 7.0.6
Calling directly on object: 0.0060091018676758 Calling call_user_func: 0.01093602180481
Output for 7.0.5
Calling directly on object: 0.0056381225585938 Calling call_user_func: 0.011934995651245
Output for 7.0.4
Calling directly on object: 0.0080890655517578 Calling call_user_func: 0.014409780502319
Output for 7.0.3
Calling directly on object: 0.0072269439697266 Calling call_user_func: 0.015102863311768
Output for 7.0.2
Calling directly on object: 0.0076990127563477 Calling call_user_func: 0.014734029769897
Output for 7.0.1
Calling directly on object: 0.006519079208374 Calling call_user_func: 0.011163949966431
Output for 7.0.0
Calling directly on object: 0.0074989795684814 Calling call_user_func: 0.013481855392456
Output for hhvm-3.12.0
Calling directly on object: 0.01362681388855 Calling call_user_func: 0.022255897521973
Output for hhvm-3.10.0
Calling directly on object: 0.017253160476685 Calling call_user_func: 0.026126146316528
Output for 5.6.28
Calling directly on object: 0.015779972076416 Calling call_user_func: 0.050574779510498
Output for 5.6.23
Calling directly on object: 0.01530385017395 Calling call_user_func: 0.050803184509277
Output for 5.6.22
Calling directly on object: 0.01149582862854 Calling call_user_func: 0.042963027954102
Output for 5.6.21
Calling directly on object: 0.0094070434570312 Calling call_user_func: 0.038762092590332
Output for 5.6.20
Calling directly on object: 0.01613712310791 Calling call_user_func: 0.058150053024292
Output for 5.6.19
Calling directly on object: 0.013640880584717 Calling call_user_func: 0.050822019577026
Output for 5.6.18
Calling directly on object: 0.011790990829468 Calling call_user_func: 0.04649806022644
Output for 5.6.17
Calling directly on object: 0.015395879745483 Calling call_user_func: 0.049155950546265
Output for 5.6.16
Calling directly on object: 0.014621019363403 Calling call_user_func: 0.047795057296753
Output for 5.6.15
Calling directly on object: 0.014484882354736 Calling call_user_func: 0.045242071151733
Output for 5.6.14
Calling directly on object: 0.013631105422974 Calling call_user_func: 0.049923896789551
Output for 5.6.13
Calling directly on object: 0.010860204696655 Calling call_user_func: 0.041477918624878
Output for 5.6.12
Calling directly on object: 0.0099658966064453 Calling call_user_func: 0.039338111877441
Output for 5.6.11
Calling directly on object: 0.015187978744507 Calling call_user_func: 0.051345109939575
Output for 5.6.10
Calling directly on object: 0.0141921043396 Calling call_user_func: 0.042995929718018
Output for 5.6.9
Calling directly on object: 0.0097229480743408 Calling call_user_func: 0.039266109466553
Output for 5.6.8
Calling directly on object: 0.011667966842651 Calling call_user_func: 0.040610074996948
Output for 5.6.7
Calling directly on object: 0.011063814163208 Calling call_user_func: 0.041460037231445
Output for 5.6.6
Calling directly on object: 0.01340913772583 Calling call_user_func: 0.048926830291748
Output for 5.6.5
Calling directly on object: 0.015208005905151 Calling call_user_func: 0.055682182312012
Output for 5.6.4
Calling directly on object: 0.012996912002563 Calling call_user_func: 0.048183917999268
Output for 5.6.3
Calling directly on object: 0.015410900115967 Calling call_user_func: 0.049409151077271
Output for 5.6.2
Calling directly on object: 0.014683961868286 Calling call_user_func: 0.051433086395264
Output for 5.6.1
Calling directly on object: 0.012090921401978 Calling call_user_func: 0.045455932617188
Output for 5.6.0
Calling directly on object: 0.016522884368896 Calling call_user_func: 0.056588888168335
Output for 5.5.37
Calling directly on object: 0.0093269348144531 Calling call_user_func: 0.039389133453369
Output for 5.5.36
Calling directly on object: 0.015429973602295 Calling call_user_func: 0.057074069976807
Output for 5.5.35
Calling directly on object: 0.0096530914306641 Calling call_user_func: 0.038836002349854
Output for 5.5.34
Calling directly on object: 0.012063980102539 Calling call_user_func: 0.045968055725098
Output for 5.5.33
Calling directly on object: 0.010721921920776 Calling call_user_func: 0.039346933364868
Output for 5.5.32
Calling directly on object: 0.011230945587158 Calling call_user_func: 0.042263031005859
Output for 5.5.31
Calling directly on object: 0.013406991958618 Calling call_user_func: 0.044096946716309
Output for 5.5.30
Calling directly on object: 0.012761831283569 Calling call_user_func: 0.044732093811035
Output for 5.5.29
Calling directly on object: 0.011602163314819 Calling call_user_func: 0.045897960662842
Output for 5.5.28
Calling directly on object: 0.0097899436950684 Calling call_user_func: 0.039602041244507
Output for 5.5.27
Calling directly on object: 0.014533996582031 Calling call_user_func: 0.047278165817261
Output for 5.5.26
Calling directly on object: 0.013122081756592 Calling call_user_func: 0.042481899261475
Output for 5.5.25
Calling directly on object: 0.014083862304688 Calling call_user_func: 0.052045822143555
Output for 5.5.24
Calling directly on object: 0.0094280242919922 Calling call_user_func: 0.039687871932983
Output for 5.5.23
Calling directly on object: 0.014179944992065 Calling call_user_func: 0.05154013633728
Output for 5.5.22
Calling directly on object: 0.012749910354614 Calling call_user_func: 0.051720857620239
Output for 5.5.21
Calling directly on object: 0.015492916107178 Calling call_user_func: 0.055851936340332
Output for 5.5.20
Calling directly on object: 0.014662981033325 Calling call_user_func: 0.043835878372192
Output for 5.5.19
Calling directly on object: 0.013101816177368 Calling call_user_func: 0.045561075210571
Output for 5.5.18
Calling directly on object: 0.01570987701416 Calling call_user_func: 0.05994701385498
Output for 5.5.16
Calling directly on object: 0.013329982757568 Calling call_user_func: 0.051586866378784
Output for 5.5.15
Calling directly on object: 0.0096659660339355 Calling call_user_func: 0.038871765136719
Output for 5.5.14
Calling directly on object: 0.013857126235962 Calling call_user_func: 0.050976037979126
Output for 5.5.13
Calling directly on object: 0.014027118682861 Calling call_user_func: 0.052074909210205
Output for 5.5.12
Calling directly on object: 0.014836072921753 Calling call_user_func: 0.053889036178589
Output for 5.5.11
Calling directly on object: 0.014575004577637 Calling call_user_func: 0.050790786743164
Output for 5.5.10
Calling directly on object: 0.013603925704956 Calling call_user_func: 0.045903921127319
Output for 5.5.9
Calling directly on object: 0.013059139251709 Calling call_user_func: 0.047769784927368
Output for 5.5.8
Calling directly on object: 0.01313591003418 Calling call_user_func: 0.045401811599731
Output for 5.5.7
Calling directly on object: 0.014749050140381 Calling call_user_func: 0.04796290397644
Output for 5.5.6
Calling directly on object: 0.0094180107116699 Calling call_user_func: 0.039062023162842
Output for 5.5.5
Calling directly on object: 0.010653972625732 Calling call_user_func: 0.039809942245483
Output for 5.5.4
Calling directly on object: 0.014166116714478 Calling call_user_func: 0.048545122146606
Output for 5.5.3
Calling directly on object: 0.01652193069458 Calling call_user_func: 0.057729959487915
Output for 5.5.2
Calling directly on object: 0.016801118850708 Calling call_user_func: 0.058550119400024
Output for 5.5.1
Calling directly on object: 0.0095620155334473 Calling call_user_func: 0.038832902908325
Output for 5.5.0
Calling directly on object: 0.011940956115723 Calling call_user_func: 0.045316934585571
Output for 5.4.45
Calling directly on object: 0.01614785194397 Calling call_user_func: 0.055037021636963
Output for 5.4.44
Calling directly on object: 0.013997077941895 Calling call_user_func: 0.047911167144775
Output for 5.4.43
Calling directly on object: 0.016208171844482 Calling call_user_func: 0.056204080581665
Output for 5.4.42
Calling directly on object: 0.016799926757812 Calling call_user_func: 0.053642988204956
Output for 5.4.41
Calling directly on object: 0.016210079193115 Calling call_user_func: 0.050843000411987
Output for 5.4.40
Calling directly on object: 0.012120962142944 Calling call_user_func: 0.042666912078857
Output for 5.4.39
Calling directly on object: 0.015646934509277 Calling call_user_func: 0.053872108459473
Output for 5.4.38
Calling directly on object: 0.016816854476929 Calling call_user_func: 0.057129859924316
Output for 5.4.37
Calling directly on object: 0.016786098480225 Calling call_user_func: 0.04925799369812
Output for 5.4.36
Calling directly on object: 0.010085105895996 Calling call_user_func: 0.038836002349854
Output for 5.4.35
Calling directly on object: 0.014616012573242 Calling call_user_func: 0.048246145248413
Output for 5.4.34
Calling directly on object: 0.012912034988403 Calling call_user_func: 0.048558950424194
Output for 5.4.32
Calling directly on object: 0.015363931655884 Calling call_user_func: 0.047789096832275
Output for 5.4.31
Calling directly on object: 0.013682842254639 Calling call_user_func: 0.04285192489624
Output for 5.4.30
Calling directly on object: 0.016196012496948 Calling call_user_func: 0.055324077606201
Output for 5.4.29
Calling directly on object: 0.013088941574097 Calling call_user_func: 0.048746109008789
Output for 5.4.28
Calling directly on object: 0.013607978820801 Calling call_user_func: 0.050534009933472
Output for 5.4.27
Calling directly on object: 0.01435112953186 Calling call_user_func: 0.045756816864014
Output for 5.4.26
Calling directly on object: 0.014614820480347 Calling call_user_func: 0.048449039459229
Output for 5.4.25
Calling directly on object: 0.014981985092163 Calling call_user_func: 0.045727014541626
Output for 5.4.24
Calling directly on object: 0.01488995552063 Calling call_user_func: 0.045706033706665
Output for 5.4.23
Calling directly on object: 0.016227006912231 Calling call_user_func: 0.046850919723511
Output for 5.4.22
Calling directly on object: 0.012391090393066 Calling call_user_func: 0.042580127716064
Output for 5.4.21
Calling directly on object: 0.01498007774353 Calling call_user_func: 0.046347856521606
Output for 5.4.20
Calling directly on object: 0.015504121780396 Calling call_user_func: 0.047917127609253
Output for 5.4.19
Calling directly on object: 0.010412931442261 Calling call_user_func: 0.039359092712402
Output for 5.4.18
Calling directly on object: 0.015245914459229 Calling call_user_func: 0.0524001121521
Output for 5.4.17
Calling directly on object: 0.0098230838775635 Calling call_user_func: 0.038920879364014
Output for 5.4.16
Calling directly on object: 0.0099380016326904 Calling call_user_func: 0.038765907287598
Output for 5.4.15
Calling directly on object: 0.013433933258057 Calling call_user_func: 0.04737401008606
Output for 5.4.14
Calling directly on object: 0.017153024673462 Calling call_user_func: 0.058941841125488
Output for 5.4.13
Calling directly on object: 0.015995979309082 Calling call_user_func: 0.058815956115723
Output for 5.4.12
Calling directly on object: 0.0099780559539795 Calling call_user_func: 0.039211988449097
Output for 5.4.11
Calling directly on object: 0.0096850395202637 Calling call_user_func: 0.039303064346313
Output for 5.4.10
Calling directly on object: 0.010341167449951 Calling call_user_func: 0.039555072784424
Output for 5.4.9
Calling directly on object: 0.009998083114624 Calling call_user_func: 0.040987968444824
Output for 5.4.8
Calling directly on object: 0.014401912689209 Calling call_user_func: 0.051136016845703
Output for 5.4.7
Calling directly on object: 0.010939121246338 Calling call_user_func: 0.041898965835571
Output for 5.4.6
Calling directly on object: 0.014750003814697 Calling call_user_func: 0.0538489818573
Output for 5.4.5
Calling directly on object: 0.012342929840088 Calling call_user_func: 0.041136980056763
Output for 5.4.4
Calling directly on object: 0.016885042190552 Calling call_user_func: 0.052021980285645
Output for 5.4.3
Calling directly on object: 0.018100023269653 Calling call_user_func: 0.050738096237183
Output for 5.4.2
Calling directly on object: 0.016648054122925 Calling call_user_func: 0.056377172470093
Output for 5.4.1
Calling directly on object: 0.012531042098999 Calling call_user_func: 0.041399955749512
Output for 5.4.0
Calling directly on object: 0.010445833206177 Calling call_user_func: 0.040533065795898
Output for 5.3.29
Calling directly on object: 0.016335010528564 Calling call_user_func: 0.041394948959351
Output for 5.3.28
Calling directly on object: 0.019603967666626 Calling call_user_func: 0.051907062530518
Output for 5.3.27
Calling directly on object: 0.021492004394531 Calling call_user_func: 0.050312995910645
Output for 5.3.26
Calling directly on object: 0.020420074462891 Calling call_user_func: 0.046915054321289
Output for 5.3.25
Calling directly on object: 0.019710063934326 Calling call_user_func: 0.046667098999023
Output for 5.3.24
Calling directly on object: 0.019820928573608 Calling call_user_func: 0.043966054916382
Output for 5.3.23
Calling directly on object: 0.022126913070679 Calling call_user_func: 0.046333074569702
Output for 5.3.22
Calling directly on object: 0.016470909118652 Calling call_user_func: 0.042536020278931
Output for 5.3.21
Calling directly on object: 0.016539812088013 Calling call_user_func: 0.042021989822388
Output for 5.3.20
Calling directly on object: 0.019115924835205 Calling call_user_func: 0.044044017791748
Output for 5.3.19
Calling directly on object: 0.020617961883545 Calling call_user_func: 0.047348976135254
Output for 5.3.18
Calling directly on object: 0.016618013381958 Calling call_user_func: 0.041515827178955
Output for 5.3.17
Calling directly on object: 0.023062944412231 Calling call_user_func: 0.052747964859009
Output for 5.3.16
Calling directly on object: 0.026921987533569 Calling call_user_func: 0.05961799621582
Output for 5.3.15
Calling directly on object: 0.020961046218872 Calling call_user_func: 0.044681072235107
Output for 5.3.14
Calling directly on object: 0.015945911407471 Calling call_user_func: 0.041374921798706
Output for 5.3.13
Calling directly on object: 0.022989988327026 Calling call_user_func: 0.053156852722168
Output for 5.3.12
Calling directly on object: 0.02155590057373 Calling call_user_func: 0.050796031951904
Output for 5.3.11
Calling directly on object: 0.023442029953003 Calling call_user_func: 0.044279813766479
Output for 5.3.10
Calling directly on object: 0.015959978103638 Calling call_user_func: 0.041554927825928
Output for 5.3.9
Calling directly on object: 0.021904945373535 Calling call_user_func: 0.051080942153931
Output for 5.3.8
Calling directly on object: 0.016187906265259 Calling call_user_func: 0.041451930999756
Output for 5.3.7
Calling directly on object: 0.016240119934082 Calling call_user_func: 0.043574094772339
Output for 5.3.6
Calling directly on object: 0.02720308303833 Calling call_user_func: 0.058511972427368
Output for 5.3.5
Calling directly on object: 0.023535966873169 Calling call_user_func: 0.053579092025757
Output for 5.3.4
Calling directly on object: 0.022423982620239 Calling call_user_func: 0.052165031433105
Output for 5.3.3
Calling directly on object: 0.016788959503174 Calling call_user_func: 0.041644096374512
Output for 5.3.2
Calling directly on object: 0.024755001068115 Calling call_user_func: 0.048827171325684
Output for 5.3.1
Calling directly on object: 0.01646614074707 Calling call_user_func: 0.04183292388916
Output for 5.3.0
Calling directly on object: 0.024849891662598 Calling call_user_func: 0.050534963607788
Output for 5.2.17
Calling directly on object: 0.030710935592651 Calling call_user_func: 0.067069053649902
Output for 5.2.16
Calling directly on object: 0.033307790756226 Calling call_user_func: 0.068866014480591
Output for 5.2.15
Calling directly on object: 0.033122062683105 Calling call_user_func: 0.075324058532715
Output for 5.2.14
Calling directly on object: 0.030514001846313 Calling call_user_func: 0.071609973907471
Output for 5.2.13
Calling directly on object: 0.029510974884033 Calling call_user_func: 0.066902160644531
Output for 5.2.12
Calling directly on object: 0.019335985183716 Calling call_user_func: 0.054008007049561
Output for 5.2.11
Calling directly on object: 0.019113063812256 Calling call_user_func: 0.054553985595703
Output for 5.2.10
Calling directly on object: 0.019235849380493 Calling call_user_func: 0.054126977920532
Output for 5.2.9
Calling directly on object: 0.026748895645142 Calling call_user_func: 0.056721210479736
Output for 5.2.8
Calling directly on object: 0.020015001296997 Calling call_user_func: 0.052877187728882
Output for 5.2.7
Calling directly on object: 0.021941900253296 Calling call_user_func: 0.05342698097229
Output for 5.2.6
Calling directly on object: 0.01963996887207 Calling call_user_func: 0.053009033203125
Output for 5.2.5
Calling directly on object: 0.032563924789429 Calling call_user_func: 0.074996948242188
Output for 5.2.4
Calling directly on object: 0.01928186416626 Calling call_user_func: 0.059787034988403
Output for 5.2.3
Calling directly on object: 0.018824100494385 Calling call_user_func: 0.059255838394165
Output for 5.2.2
Calling directly on object: 0.02470588684082 Calling call_user_func: 0.074431896209717
Output for 5.2.1
Calling directly on object: 0.031535863876343 Calling call_user_func: 0.081031084060669
Output for 5.2.0
Calling directly on object: 0.029839038848877 Calling call_user_func: 0.077037811279297
Output for 5.1.6
Calling directly on object: 0.018757104873657 Calling call_user_func: 0.04980206489563
Output for 5.1.5
Calling directly on object: 0.035029172897339 Calling call_user_func: 0.078387975692749
Output for 5.1.4
Calling directly on object: 0.027183055877686 Calling call_user_func: 0.061263084411621
Output for 5.1.3
Calling directly on object: 0.030494928359985 Calling call_user_func: 0.054993152618408
Output for 5.1.2
Calling directly on object: 0.030898094177246 Calling call_user_func: 0.059053897857666
Output for 5.1.1
Calling directly on object: 0.021525144577026 Calling call_user_func: 0.049794912338257
Output for 5.1.0
Calling directly on object: 0.030580043792725 Calling call_user_func: 0.062484979629517
Output for 5.0.5
Calling directly on object: 0.065954923629761 Calling call_user_func: 0.097990989685059
Output for 5.0.4
Calling directly on object: 0.046751976013184 Calling call_user_func: 0.07714581489563
Output for 5.0.3
Calling directly on object: 0.051202058792114 Calling call_user_func: 0.076292991638184
Output for 5.0.2
Calling directly on object: 0.033891201019287 Calling call_user_func: 0.07249903678894
Output for 5.0.1
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/4BFIN on line 21 Calling directly on object: 0.049052000045776PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/4BFIN on line 30 Calling call_user_func: 0.077532052993774PHP_EOL
Output for 5.0.0
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/4BFIN on line 21 Calling directly on object: 0.050359010696411PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/4BFIN on line 30 Calling call_user_func: 0.073827981948853PHP_EOL
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/4BFIN on line 5
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/4BFIN on line 5
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/4BFIN on line 5
Process exited with code 255.