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.0085020065307617 Calling call_user_func: 0.016407012939453
Output for 7.0.14
Calling directly on object: 0.013334989547729 Calling call_user_func: 0.02108097076416
Output for 7.0.7
Calling directly on object: 0.0072979927062988 Calling call_user_func: 0.014056921005249
Output for 7.0.6
Calling directly on object: 0.0077528953552246 Calling call_user_func: 0.014467000961304
Output for 7.0.5
Calling directly on object: 0.0081460475921631 Calling call_user_func: 0.016338109970093
Output for 7.0.4
Calling directly on object: 0.0065710544586182 Calling call_user_func: 0.013525009155273
Output for 7.0.3
Calling directly on object: 0.0079529285430908 Calling call_user_func: 0.015836954116821
Output for 7.0.2
Calling directly on object: 0.0081140995025635 Calling call_user_func: 0.017251968383789
Output for 7.0.1
Calling directly on object: 0.0081210136413574 Calling call_user_func: 0.016243934631348
Output for 7.0.0
Calling directly on object: 0.0081789493560791 Calling call_user_func: 0.016013145446777
Output for hhvm-3.12.0
Calling directly on object: 0.014586925506592 Calling call_user_func: 0.023778200149536
Output for hhvm-3.10.0
Calling directly on object: 0.017444849014282 Calling call_user_func: 0.026932954788208
Output for 5.6.28
Calling directly on object: 0.01628303527832 Calling call_user_func: 0.050580978393555
Output for 5.6.22
Calling directly on object: 0.015022993087769 Calling call_user_func: 0.048712015151978
Output for 5.6.21
Calling directly on object: 0.013617038726807 Calling call_user_func: 0.049487113952637
Output for 5.6.20
Calling directly on object: 0.014877080917358 Calling call_user_func: 0.044800996780396
Output for 5.6.19
Calling directly on object: 0.014230966567993 Calling call_user_func: 0.049657106399536
Output for 5.6.18
Calling directly on object: 0.014680147171021 Calling call_user_func: 0.051263093948364
Output for 5.6.17
Calling directly on object: 0.015146970748901 Calling call_user_func: 0.053287029266357
Output for 5.6.16
Calling directly on object: 0.014610052108765 Calling call_user_func: 0.052932024002075
Output for 5.6.15
Calling directly on object: 0.013553142547607 Calling call_user_func: 0.044981002807617
Output for 5.6.14
Calling directly on object: 0.017880201339722 Calling call_user_func: 0.051214933395386
Output for 5.6.13
Calling directly on object: 0.016533136367798 Calling call_user_func: 0.054028987884521
Output for 5.6.12
Calling directly on object: 0.014295101165771 Calling call_user_func: 0.046634912490845
Output for 5.6.11
Calling directly on object: 0.01545786857605 Calling call_user_func: 0.053652048110962
Output for 5.6.10
Calling directly on object: 0.014932870864868 Calling call_user_func: 0.051892042160034
Output for 5.6.9
Calling directly on object: 0.013829946517944 Calling call_user_func: 0.048881053924561
Output for 5.6.8
Calling directly on object: 0.014891862869263 Calling call_user_func: 0.051292181015015
Output for 5.6.7
Calling directly on object: 0.013833999633789 Calling call_user_func: 0.052191972732544
Output for 5.6.6
Calling directly on object: 0.010524988174438 Calling call_user_func: 0.039951086044312
Output for 5.6.5
Calling directly on object: 0.009544849395752 Calling call_user_func: 0.038619041442871
Output for 5.6.4
Calling directly on object: 0.0080668926239014 Calling call_user_func: 0.032167911529541
Output for 5.6.3
Calling directly on object: 0.0085840225219727 Calling call_user_func: 0.033245086669922
Output for 5.6.2
Calling directly on object: 0.013125896453857 Calling call_user_func: 0.045416831970215
Output for 5.6.1
Calling directly on object: 0.01863694190979 Calling call_user_func: 0.059067964553833
Output for 5.6.0
Calling directly on object: 0.0085508823394775 Calling call_user_func: 0.036144018173218
Output for 5.5.36
Calling directly on object: 0.015172958374023 Calling call_user_func: 0.052342891693115
Output for 5.5.35
Calling directly on object: 0.014941930770874 Calling call_user_func: 0.052155017852783
Output for 5.5.34
Calling directly on object: 0.016244888305664 Calling call_user_func: 0.053894996643066
Output for 5.5.33
Calling directly on object: 0.013550043106079 Calling call_user_func: 0.047384023666382
Output for 5.5.32
Calling directly on object: 0.016096830368042 Calling call_user_func: 0.055434942245483
Output for 5.5.31
Calling directly on object: 0.016077041625977 Calling call_user_func: 0.053894996643066
Output for 5.5.30
Calling directly on object: 0.014112234115601 Calling call_user_func: 0.050014019012451
Output for 5.5.29
Calling directly on object: 0.013252019882202 Calling call_user_func: 0.047307014465332
Output for 5.5.28
Calling directly on object: 0.013262033462524 Calling call_user_func: 0.044705152511597
Output for 5.5.27
Calling directly on object: 0.014152050018311 Calling call_user_func: 0.048961162567139
Output for 5.5.26
Calling directly on object: 0.014471054077148 Calling call_user_func: 0.049998044967651
Output for 5.5.25
Calling directly on object: 0.01141095161438 Calling call_user_func: 0.041252136230469
Output for 5.5.24
Calling directly on object: 0.012205839157104 Calling call_user_func: 0.045096874237061
Output for 5.5.23
Calling directly on object: 0.015059232711792 Calling call_user_func: 0.052836894989014
Output for 5.5.22
Calling directly on object: 0.0098679065704346 Calling call_user_func: 0.046256065368652
Output for 5.5.21
Calling directly on object: 0.0096371173858643 Calling call_user_func: 0.039374113082886
Output for 5.5.20
Calling directly on object: 0.0081961154937744 Calling call_user_func: 0.033114910125732
Output for 5.5.19
Calling directly on object: 0.0078608989715576 Calling call_user_func: 0.032332897186279
Output for 5.5.18
Calling directly on object: 0.0079469680786133 Calling call_user_func: 0.032351970672607
Output for 5.5.16
Calling directly on object: 0.0078158378601074 Calling call_user_func: 0.050900936126709
Output for 5.5.15
Calling directly on object: 0.0077989101409912 Calling call_user_func: 0.031965017318726
Output for 5.5.14
Calling directly on object: 0.0092661380767822 Calling call_user_func: 0.042207956314087
Output for 5.5.13
Calling directly on object: 0.0081460475921631 Calling call_user_func: 0.032170057296753
Output for 5.5.12
Calling directly on object: 0.0090210437774658 Calling call_user_func: 0.034033060073853
Output for 5.5.11
Calling directly on object: 0.0085568428039551 Calling call_user_func: 0.035135984420776
Output for 5.5.10
Calling directly on object: 0.007904052734375 Calling call_user_func: 0.03206992149353
Output for 5.5.9
Calling directly on object: 0.0086460113525391 Calling call_user_func: 0.033709049224854
Output for 5.5.8
Calling directly on object: 0.0078930854797363 Calling call_user_func: 0.031856060028076
Output for 5.5.7
Calling directly on object: 0.0084919929504395 Calling call_user_func: 0.035771131515503
Output for 5.5.6
Calling directly on object: 0.008234977722168 Calling call_user_func: 0.035500049591064
Output for 5.5.5
Calling directly on object: 0.015605926513672 Calling call_user_func: 0.051199913024902
Output for 5.5.4
Calling directly on object: 0.015445947647095 Calling call_user_func: 0.053167104721069
Output for 5.5.3
Calling directly on object: 0.015011787414551 Calling call_user_func: 0.044573068618774
Output for 5.5.2
Calling directly on object: 0.01836895942688 Calling call_user_func: 0.062707185745239
Output for 5.5.1
Calling directly on object: 0.0097198486328125 Calling call_user_func: 0.04068398475647
Output for 5.5.0
Calling directly on object: 0.015891075134277 Calling call_user_func: 0.05876898765564
Output for 5.4.45
Calling directly on object: 0.016244888305664 Calling call_user_func: 0.052929878234863
Output for 5.4.44
Calling directly on object: 0.014564990997314 Calling call_user_func: 0.047415018081665
Output for 5.4.43
Calling directly on object: 0.014388799667358 Calling call_user_func: 0.049475908279419
Output for 5.4.42
Calling directly on object: 0.015368938446045 Calling call_user_func: 0.052146911621094
Output for 5.4.41
Calling directly on object: 0.015816926956177 Calling call_user_func: 0.053300142288208
Output for 5.4.40
Calling directly on object: 0.014672994613647 Calling call_user_func: 0.049423933029175
Output for 5.4.39
Calling directly on object: 0.01550817489624 Calling call_user_func: 0.055291891098022
Output for 5.4.38
Calling directly on object: 0.012001037597656 Calling call_user_func: 0.042294979095459
Output for 5.4.37
Calling directly on object: 0.0099430084228516 Calling call_user_func: 0.039528131484985
Output for 5.4.36
Calling directly on object: 0.0095999240875244 Calling call_user_func: 0.034795999526978
Output for 5.4.35
Calling directly on object: 0.0097990036010742 Calling call_user_func: 0.036695003509521
Output for 5.4.34
Calling directly on object: 0.009465217590332 Calling call_user_func: 0.035552978515625
Output for 5.4.32
Calling directly on object: 0.018730878829956 Calling call_user_func: 0.04529595375061
Output for 5.4.31
Calling directly on object: 0.0086169242858887 Calling call_user_func: 0.033227920532227
Output for 5.4.30
Calling directly on object: 0.0082879066467285 Calling call_user_func: 0.031944990158081
Output for 5.4.29
Calling directly on object: 0.0078139305114746 Calling call_user_func: 0.032207012176514
Output for 5.4.28
Calling directly on object: 0.0078439712524414 Calling call_user_func: 0.032063007354736
Output for 5.4.27
Calling directly on object: 0.0089960098266602 Calling call_user_func: 0.035169124603271
Output for 5.4.26
Calling directly on object: 0.008112907409668 Calling call_user_func: 0.032832145690918
Output for 5.4.25
Calling directly on object: 0.01072883605957 Calling call_user_func: 0.040014028549194
Output for 5.4.24
Calling directly on object: 0.0085952281951904 Calling call_user_func: 0.03358793258667
Output for 5.4.23
Calling directly on object: 0.015106201171875 Calling call_user_func: 0.048036813735962
Output for 5.4.22
Calling directly on object: 0.0085780620574951 Calling call_user_func: 0.032814979553223
Output for 5.4.21
Calling directly on object: 0.009782075881958 Calling call_user_func: 0.03619909286499
Output for 5.4.20
Calling directly on object: 0.013599872589111 Calling call_user_func: 0.047741174697876
Output for 5.4.19
Calling directly on object: 0.015249013900757 Calling call_user_func: 0.054823875427246
Output for 5.4.18
Calling directly on object: 0.0081040859222412 Calling call_user_func: 0.032312154769897
Output for 5.4.17
Calling directly on object: 0.010765790939331 Calling call_user_func: 0.040126085281372
Output for 5.4.16
Calling directly on object: 0.016318082809448 Calling call_user_func: 0.055852890014648
Output for 5.4.15
Calling directly on object: 0.015192985534668 Calling call_user_func: 0.051234006881714
Output for 5.4.14
Calling directly on object: 0.016370058059692 Calling call_user_func: 0.052538156509399
Output for 5.4.13
Calling directly on object: 0.014933109283447 Calling call_user_func: 0.054062128067017
Output for 5.4.12
Calling directly on object: 0.016941070556641 Calling call_user_func: 0.056333065032959
Output for 5.4.11
Calling directly on object: 0.017380952835083 Calling call_user_func: 0.05574107170105
Output for 5.4.10
Calling directly on object: 0.016692876815796 Calling call_user_func: 0.051208019256592
Output for 5.4.9
Calling directly on object: 0.015334129333496 Calling call_user_func: 0.051954030990601
Output for 5.4.8
Calling directly on object: 0.016557931900024 Calling call_user_func: 0.055315971374512
Output for 5.4.7
Calling directly on object: 0.015947818756104 Calling call_user_func: 0.054513931274414
Output for 5.4.6
Calling directly on object: 0.015535116195679 Calling call_user_func: 0.053262948989868
Output for 5.4.5
Calling directly on object: 0.015630960464478 Calling call_user_func: 0.051615953445435
Output for 5.4.4
Calling directly on object: 0.016978025436401 Calling call_user_func: 0.06280517578125
Output for 5.4.3
Calling directly on object: 0.010108947753906 Calling call_user_func: 0.039044141769409
Output for 5.4.2
Calling directly on object: 0.015424966812134 Calling call_user_func: 0.050945043563843
Output for 5.4.1
Calling directly on object: 0.01370906829834 Calling call_user_func: 0.047039985656738
Output for 5.4.0
Calling directly on object: 0.014112949371338 Calling call_user_func: 0.048443078994751
Output for 5.3.29
Calling directly on object: 0.013138055801392 Calling call_user_func: 0.034041881561279
Output for 5.3.28
Calling directly on object: 0.014894008636475 Calling call_user_func: 0.035748958587646
Output for 5.3.27
Calling directly on object: 0.016518831253052 Calling call_user_func: 0.042306900024414
Output for 5.3.26
Calling directly on object: 0.023165941238403 Calling call_user_func: 0.051900863647461
Output for 5.3.25
Calling directly on object: 0.023408889770508 Calling call_user_func: 0.049978971481323
Output for 5.3.24
Calling directly on object: 0.024168014526367 Calling call_user_func: 0.049256086349487
Output for 5.3.23
Calling directly on object: 0.025535106658936 Calling call_user_func: 0.05402398109436
Output for 5.3.22
Calling directly on object: 0.026796817779541 Calling call_user_func: 0.055426836013794
Output for 5.3.21
Calling directly on object: 0.023712873458862 Calling call_user_func: 0.052008152008057
Output for 5.3.20
Calling directly on object: 0.024770021438599 Calling call_user_func: 0.04935097694397
Output for 5.3.19
Calling directly on object: 0.0242600440979 Calling call_user_func: 0.054331064224243
Output for 5.3.18
Calling directly on object: 0.023951053619385 Calling call_user_func: 0.052664995193481
Output for 5.3.17
Calling directly on object: 0.025048017501831 Calling call_user_func: 0.053869009017944
Output for 5.3.16
Calling directly on object: 0.02317214012146 Calling call_user_func: 0.05169415473938
Output for 5.3.15
Calling directly on object: 0.024306058883667 Calling call_user_func: 0.056180953979492
Output for 5.3.14
Calling directly on object: 0.017152786254883 Calling call_user_func: 0.041913032531738
Output for 5.3.13
Calling directly on object: 0.016443014144897 Calling call_user_func: 0.043198108673096
Output for 5.3.12
Calling directly on object: 0.015820980072021 Calling call_user_func: 0.042289972305298
Output for 5.3.11
Calling directly on object: 0.019078969955444 Calling call_user_func: 0.044180154800415
Output for 5.3.10
Calling directly on object: 0.026221036911011 Calling call_user_func: 0.055172920227051
Output for 5.3.9
Calling directly on object: 0.026006937026978 Calling call_user_func: 0.054699182510376
Output for 5.3.8
Calling directly on object: 0.025086879730225 Calling call_user_func: 0.051972150802612
Output for 5.3.7
Calling directly on object: 0.021826028823853 Calling call_user_func: 0.047095060348511
Output for 5.3.6
Calling directly on object: 0.025621891021729 Calling call_user_func: 0.052736043930054
Output for 5.3.5
Calling directly on object: 0.024080991744995 Calling call_user_func: 0.048990964889526
Output for 5.3.4
Calling directly on object: 0.023004055023193 Calling call_user_func: 0.047911882400513
Output for 5.3.3
Calling directly on object: 0.025135040283203 Calling call_user_func: 0.054946899414062
Output for 5.3.2
Calling directly on object: 0.025351047515869 Calling call_user_func: 0.054555892944336
Output for 5.3.1
Calling directly on object: 0.025327920913696 Calling call_user_func: 0.054651021957397
Output for 5.3.0
Calling directly on object: 0.026695013046265 Calling call_user_func: 0.047662973403931
Output for 5.2.17
Calling directly on object: 0.019045114517212 Calling call_user_func: 0.052817106246948
Output for 5.2.16
Calling directly on object: 0.024677038192749 Calling call_user_func: 0.057421922683716
Output for 5.2.15
Calling directly on object: 0.020735025405884 Calling call_user_func: 0.05356502532959
Output for 5.2.14
Calling directly on object: 0.028343915939331 Calling call_user_func: 0.066707134246826
Output for 5.2.13
Calling directly on object: 0.028489112854004 Calling call_user_func: 0.065217018127441
Output for 5.2.12
Calling directly on object: 0.02790093421936 Calling call_user_func: 0.062196016311646
Output for 5.2.11
Calling directly on object: 0.033170938491821 Calling call_user_func: 0.074201107025146
Output for 5.2.10
Calling directly on object: 0.030977010726929 Calling call_user_func: 0.070226907730103
Output for 5.2.9
Calling directly on object: 0.022589921951294 Calling call_user_func: 0.05668306350708
Output for 5.2.8
Calling directly on object: 0.029935121536255 Calling call_user_func: 0.066757917404175
Output for 5.2.7
Calling directly on object: 0.028764963150024 Calling call_user_func: 0.058412075042725
Output for 5.2.6
Calling directly on object: 0.032371044158936 Calling call_user_func: 0.070780038833618
Output for 5.2.5
Calling directly on object: 0.030344009399414 Calling call_user_func: 0.074558019638062
Output for 5.2.4
Calling directly on object: 0.030476093292236 Calling call_user_func: 0.074980020523071
Output for 5.2.3
Calling directly on object: 0.030919075012207 Calling call_user_func: 0.07402491569519
Output for 5.2.2
Calling directly on object: 0.023009061813354 Calling call_user_func: 0.063843965530396
Output for 5.2.1
Calling directly on object: 0.024649143218994 Calling call_user_func: 0.066075086593628
Output for 5.2.0
Calling directly on object: 0.028529167175293 Calling call_user_func: 0.070110082626343
Output for 5.1.6
Calling directly on object: 0.034069061279297 Calling call_user_func: 0.070132970809937
Output for 5.1.5
Calling directly on object: 0.033066987991333 Calling call_user_func: 0.071148157119751
Output for 5.1.4
Calling directly on object: 0.031599998474121 Calling call_user_func: 0.064136028289795
Output for 5.1.3
Calling directly on object: 0.030951023101807 Calling call_user_func: 0.06537389755249
Output for 5.1.2
Calling directly on object: 0.032546997070312 Calling call_user_func: 0.067044973373413
Output for 5.1.1
Calling directly on object: 0.031459093093872 Calling call_user_func: 0.064566850662231
Output for 5.1.0
Calling directly on object: 0.031414985656738 Calling call_user_func: 0.064301013946533
Output for 5.0.5
Calling directly on object: 0.037566184997559 Calling call_user_func: 0.073674201965332
Output for 5.0.4
Calling directly on object: 0.056738138198853 Calling call_user_func: 0.082520961761475
Output for 5.0.3
Calling directly on object: 0.032922983169556 Calling call_user_func: 0.07241415977478
Output for 5.0.2
Calling directly on object: 0.033092975616455 Calling call_user_func: 0.070775032043457
Output for 5.0.1
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/UubGr on line 20 Calling directly on object: 0.042971134185791PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/UubGr on line 27 Calling call_user_func: 0.073915004730225PHP_EOL
Output for 5.0.0
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/UubGr on line 20 Calling directly on object: 0.053452968597412PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/UubGr on line 27 Calling call_user_func: 0.081629991531372PHP_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/UubGr 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/UubGr 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/UubGr on line 5
Process exited with code 255.