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(array($foo, $method), $args); } echo 'Calling call_user_func: ' . (microtime(true) - $start) . PHP_EOL;
Output for 7.1.0
Calling directly on object: 0.0062129497528076 Calling call_user_func: 0.011094093322754
Output for 7.0.14
Calling directly on object: 0.012884140014648 Calling call_user_func: 0.019424915313721
Output for 7.0.7
Calling directly on object: 0.0088980197906494 Calling call_user_func: 0.015220165252686
Output for 7.0.6
Calling directly on object: 0.0070030689239502 Calling call_user_func: 0.013121843338013
Output for 7.0.5
Calling directly on object: 0.0080580711364746 Calling call_user_func: 0.015562057495117
Output for 7.0.4
Calling directly on object: 0.0075910091400146 Calling call_user_func: 0.014447927474976
Output for 7.0.3
Calling directly on object: 0.010138988494873 Calling call_user_func: 0.01718282699585
Output for 7.0.2
Calling directly on object: 0.0053799152374268 Calling call_user_func: 0.010385036468506
Output for 7.0.1
Calling directly on object: 0.00748610496521 Calling call_user_func: 0.013967990875244
Output for 7.0.0
Calling directly on object: 0.0071690082550049 Calling call_user_func: 0.012488126754761
Output for hhvm-3.12.0
Calling directly on object: 0.014656066894531 Calling call_user_func: 0.022252082824707
Output for hhvm-3.10.0
Calling directly on object: 0.021435976028442 Calling call_user_func: 0.029514074325562
Output for 5.6.28
Calling directly on object: 0.015857934951782 Calling call_user_func: 0.058947801589966
Output for 5.6.22
Calling directly on object: 0.013668060302734 Calling call_user_func: 0.056904792785645
Output for 5.6.21
Calling directly on object: 0.015223979949951 Calling call_user_func: 0.054327964782715
Output for 5.6.20
Calling directly on object: 0.013775110244751 Calling call_user_func: 0.049233913421631
Output for 5.6.19
Calling directly on object: 0.012398958206177 Calling call_user_func: 0.048225879669189
Output for 5.6.18
Calling directly on object: 0.013656139373779 Calling call_user_func: 0.053492069244385
Output for 5.6.17
Calling directly on object: 0.011025190353394 Calling call_user_func: 0.04611611366272
Output for 5.6.16
Calling directly on object: 0.014940023422241 Calling call_user_func: 0.059306144714355
Output for 5.6.15
Calling directly on object: 0.01837682723999 Calling call_user_func: 0.061543941497803
Output for 5.6.14
Calling directly on object: 0.014426946640015 Calling call_user_func: 0.051887035369873
Output for 5.6.13
Calling directly on object: 0.010382175445557 Calling call_user_func: 0.043944120407104
Output for 5.6.12
Calling directly on object: 0.01340913772583 Calling call_user_func: 0.058969974517822
Output for 5.6.11
Calling directly on object: 0.012110948562622 Calling call_user_func: 0.045846939086914
Output for 5.6.10
Calling directly on object: 0.013597011566162 Calling call_user_func: 0.054635047912598
Output for 5.6.9
Calling directly on object: 0.015694141387939 Calling call_user_func: 0.061789035797119
Output for 5.6.8
Calling directly on object: 0.016348123550415 Calling call_user_func: 0.060924053192139
Output for 5.6.7
Calling directly on object: 0.014385938644409 Calling call_user_func: 0.057965040206909
Output for 5.6.6
Calling directly on object: 0.010946035385132 Calling call_user_func: 0.0454261302948
Output for 5.6.5
Calling directly on object: 0.01488995552063 Calling call_user_func: 0.05113697052002
Output for 5.6.4
Calling directly on object: 0.017560958862305 Calling call_user_func: 0.068902969360352
Output for 5.6.3
Calling directly on object: 0.01649808883667 Calling call_user_func: 0.062498807907104
Output for 5.6.2
Calling directly on object: 0.011359930038452 Calling call_user_func: 0.046857118606567
Output for 5.6.1
Calling directly on object: 0.01606297492981 Calling call_user_func: 0.059306859970093
Output for 5.6.0
Calling directly on object: 0.016849994659424 Calling call_user_func: 0.062479019165039
Output for 5.5.36
Calling directly on object: 0.015576124191284 Calling call_user_func: 0.060240983963013
Output for 5.5.35
Calling directly on object: 0.015659093856812 Calling call_user_func: 0.06143593788147
Output for 5.5.34
Calling directly on object: 0.014628887176514 Calling call_user_func: 0.053121089935303
Output for 5.5.33
Calling directly on object: 0.013411045074463 Calling call_user_func: 0.05295205116272
Output for 5.5.32
Calling directly on object: 0.011984825134277 Calling call_user_func: 0.046772003173828
Output for 5.5.31
Calling directly on object: 0.015755176544189 Calling call_user_func: 0.062478065490723
Output for 5.5.30
Calling directly on object: 0.015654802322388 Calling call_user_func: 0.0621018409729
Output for 5.5.29
Calling directly on object: 0.0099849700927734 Calling call_user_func: 0.042785882949829
Output for 5.5.28
Calling directly on object: 0.010283946990967 Calling call_user_func: 0.049281120300293
Output for 5.5.27
Calling directly on object: 0.016140937805176 Calling call_user_func: 0.060080051422119
Output for 5.5.26
Calling directly on object: 0.013362169265747 Calling call_user_func: 0.049449920654297
Output for 5.5.25
Calling directly on object: 0.014247894287109 Calling call_user_func: 0.05804705619812
Output for 5.5.24
Calling directly on object: 0.016029119491577 Calling call_user_func: 0.052402973175049
Output for 5.5.23
Calling directly on object: 0.014627933502197 Calling call_user_func: 0.059122800827026
Output for 5.5.22
Calling directly on object: 0.011703968048096 Calling call_user_func: 0.052525997161865
Output for 5.5.21
Calling directly on object: 0.010118007659912 Calling call_user_func: 0.045855045318604
Output for 5.5.20
Calling directly on object: 0.018389940261841 Calling call_user_func: 0.065804004669189
Output for 5.5.19
Calling directly on object: 0.015926837921143 Calling call_user_func: 0.063850164413452
Output for 5.5.18
Calling directly on object: 0.014217853546143 Calling call_user_func: 0.049514055252075
Output for 5.5.16
Calling directly on object: 0.016142845153809 Calling call_user_func: 0.057960033416748
Output for 5.5.15
Calling directly on object: 0.011146783828735 Calling call_user_func: 0.043589115142822
Output for 5.5.14
Calling directly on object: 0.012825012207031 Calling call_user_func: 0.051064968109131
Output for 5.5.13
Calling directly on object: 0.013468980789185 Calling call_user_func: 0.047868013381958
Output for 5.5.12
Calling directly on object: 0.012181997299194 Calling call_user_func: 0.051845073699951
Output for 5.5.11
Calling directly on object: 0.015531063079834 Calling call_user_func: 0.060044050216675
Output for 5.5.10
Calling directly on object: 0.0098369121551514 Calling call_user_func: 0.04314398765564
Output for 5.5.9
Calling directly on object: 0.017752885818481 Calling call_user_func: 0.058640956878662
Output for 5.5.8
Calling directly on object: 0.013000011444092 Calling call_user_func: 0.045853853225708
Output for 5.5.7
Calling directly on object: 0.015136003494263 Calling call_user_func: 0.05488109588623
Output for 5.5.6
Calling directly on object: 0.0098931789398193 Calling call_user_func: 0.045027017593384
Output for 5.5.5
Calling directly on object: 0.013018131256104 Calling call_user_func: 0.047510862350464
Output for 5.5.4
Calling directly on object: 0.013331890106201 Calling call_user_func: 0.051748037338257
Output for 5.5.3
Calling directly on object: 0.015758037567139 Calling call_user_func: 0.057287931442261
Output for 5.5.2
Calling directly on object: 0.014213085174561 Calling call_user_func: 0.057296991348267
Output for 5.5.1
Calling directly on object: 0.010215997695923 Calling call_user_func: 0.045785188674927
Output for 5.5.0
Calling directly on object: 0.012397050857544 Calling call_user_func: 0.055244207382202
Output for 5.4.45
Calling directly on object: 0.012328863143921 Calling call_user_func: 0.047750949859619
Output for 5.4.44
Calling directly on object: 0.017266035079956 Calling call_user_func: 0.060768842697144
Output for 5.4.43
Calling directly on object: 0.016481161117554 Calling call_user_func: 0.057541847229004
Output for 5.4.42
Calling directly on object: 0.016275882720947 Calling call_user_func: 0.061514139175415
Output for 5.4.41
Calling directly on object: 0.010923147201538 Calling call_user_func: 0.0434410572052
Output for 5.4.40
Calling directly on object: 0.01612401008606 Calling call_user_func: 0.055859088897705
Output for 5.4.39
Calling directly on object: 0.014632940292358 Calling call_user_func: 0.049640893936157
Output for 5.4.38
Calling directly on object: 0.016262054443359 Calling call_user_func: 0.054671049118042
Output for 5.4.37
Calling directly on object: 0.011463165283203 Calling call_user_func: 0.043024063110352
Output for 5.4.36
Calling directly on object: 0.010063886642456 Calling call_user_func: 0.042790174484253
Output for 5.4.35
Calling directly on object: 0.015978097915649 Calling call_user_func: 0.058382987976074
Output for 5.4.34
Calling directly on object: 0.017710208892822 Calling call_user_func: 0.064878940582275
Output for 5.4.32
Calling directly on object: 0.017057180404663 Calling call_user_func: 0.056580066680908
Output for 5.4.31
Calling directly on object: 0.015622138977051 Calling call_user_func: 0.056845903396606
Output for 5.4.30
Calling directly on object: 0.017096996307373 Calling call_user_func: 0.055279016494751
Output for 5.4.29
Calling directly on object: 0.015491962432861 Calling call_user_func: 0.061005115509033
Output for 5.4.28
Calling directly on object: 0.020064115524292 Calling call_user_func: 0.06504487991333
Output for 5.4.27
Calling directly on object: 0.017307043075562 Calling call_user_func: 0.062992095947266
Output for 5.4.26
Calling directly on object: 0.014380931854248 Calling call_user_func: 0.058491945266724
Output for 5.4.25
Calling directly on object: 0.015247821807861 Calling call_user_func: 0.058867931365967
Output for 5.4.24
Calling directly on object: 0.016199827194214 Calling call_user_func: 0.053201198577881
Output for 5.4.23
Calling directly on object: 0.01544713973999 Calling call_user_func: 0.057626962661743
Output for 5.4.22
Calling directly on object: 0.014995813369751 Calling call_user_func: 0.052854061126709
Output for 5.4.21
Calling directly on object: 0.016664028167725 Calling call_user_func: 0.062489032745361
Output for 5.4.20
Calling directly on object: 0.013442039489746 Calling call_user_func: 0.048174858093262
Output for 5.4.19
Calling directly on object: 0.012993097305298 Calling call_user_func: 0.052957057952881
Output for 5.4.18
Calling directly on object: 0.010656118392944 Calling call_user_func: 0.045775175094604
Output for 5.4.17
Calling directly on object: 0.0098879337310791 Calling call_user_func: 0.043020009994507
Output for 5.4.16
Calling directly on object: 0.013935089111328 Calling call_user_func: 0.05368709564209
Output for 5.4.15
Calling directly on object: 0.010096073150635 Calling call_user_func: 0.043462991714478
Output for 5.4.14
Calling directly on object: 0.010082960128784 Calling call_user_func: 0.042670965194702
Output for 5.4.13
Calling directly on object: 0.0096840858459473 Calling call_user_func: 0.043395042419434
Output for 5.4.12
Calling directly on object: 0.0099160671234131 Calling call_user_func: 0.042818069458008
Output for 5.4.11
Calling directly on object: 0.012918949127197 Calling call_user_func: 0.050806999206543
Output for 5.4.10
Calling directly on object: 0.010730028152466 Calling call_user_func: 0.04187798500061
Output for 5.4.9
Calling directly on object: 0.011059045791626 Calling call_user_func: 0.043664932250977
Output for 5.4.8
Calling directly on object: 0.010208129882812 Calling call_user_func: 0.043179988861084
Output for 5.4.7
Calling directly on object: 0.010303020477295 Calling call_user_func: 0.044034957885742
Output for 5.4.6
Calling directly on object: 0.0086770057678223 Calling call_user_func: 0.037283182144165
Output for 5.4.5
Calling directly on object: 0.0085489749908447 Calling call_user_func: 0.036655902862549
Output for 5.4.4
Calling directly on object: 0.01371693611145 Calling call_user_func: 0.049872875213623
Output for 5.4.3
Calling directly on object: 0.01006293296814 Calling call_user_func: 0.042232036590576
Output for 5.4.2
Calling directly on object: 0.012260913848877 Calling call_user_func: 0.044299125671387
Output for 5.4.1
Calling directly on object: 0.020159006118774 Calling call_user_func: 0.066079139709473
Output for 5.4.0
Calling directly on object: 0.016414880752563 Calling call_user_func: 0.063780784606934
Output for 5.3.29
Calling directly on object: 0.02668309211731 Calling call_user_func: 0.058011054992676
Output for 5.3.28
Calling directly on object: 0.02531909942627 Calling call_user_func: 0.064205169677734
Output for 5.3.27
Calling directly on object: 0.022112846374512 Calling call_user_func: 0.052012920379639
Output for 5.3.26
Calling directly on object: 0.018383026123047 Calling call_user_func: 0.046562910079956
Output for 5.3.25
Calling directly on object: 0.01649284362793 Calling call_user_func: 0.048449993133545
Output for 5.3.24
Calling directly on object: 0.026313066482544 Calling call_user_func: 0.065204858779907
Output for 5.3.23
Calling directly on object: 0.016319990158081 Calling call_user_func: 0.046617031097412
Output for 5.3.22
Calling directly on object: 0.017112970352173 Calling call_user_func: 0.050475835800171
Output for 5.3.21
Calling directly on object: 0.016032934188843 Calling call_user_func: 0.047478199005127
Output for 5.3.20
Calling directly on object: 0.016210079193115 Calling call_user_func: 0.048575162887573
Output for 5.3.19
Calling directly on object: 0.015558004379272 Calling call_user_func: 0.043880939483643
Output for 5.3.18
Calling directly on object: 0.018390893936157 Calling call_user_func: 0.049442052841187
Output for 5.3.17
Calling directly on object: 0.01633095741272 Calling call_user_func: 0.048407077789307
Output for 5.3.16
Calling directly on object: 0.015594005584717 Calling call_user_func: 0.047298908233643
Output for 5.3.15
Calling directly on object: 0.015791893005371 Calling call_user_func: 0.047568082809448
Output for 5.3.14
Calling directly on object: 0.017853975296021 Calling call_user_func: 0.049093961715698
Output for 5.3.13
Calling directly on object: 0.015794038772583 Calling call_user_func: 0.046734809875488
Output for 5.3.12
Calling directly on object: 0.017802953720093 Calling call_user_func: 0.049638986587524
Output for 5.3.11
Calling directly on object: 0.026466846466064 Calling call_user_func: 0.06641411781311
Output for 5.3.10
Calling directly on object: 0.016349077224731 Calling call_user_func: 0.048181056976318
Output for 5.3.9
Calling directly on object: 0.024312019348145 Calling call_user_func: 0.06215500831604
Output for 5.3.8
Calling directly on object: 0.023531913757324 Calling call_user_func: 0.054625988006592
Output for 5.3.7
Calling directly on object: 0.026517868041992 Calling call_user_func: 0.064124822616577
Output for 5.3.6
Calling directly on object: 0.022325038909912 Calling call_user_func: 0.058341979980469
Output for 5.3.5
Calling directly on object: 0.023272037506104 Calling call_user_func: 0.061865091323853
Output for 5.3.4
Calling directly on object: 0.022595882415771 Calling call_user_func: 0.054877996444702
Output for 5.3.3
Calling directly on object: 0.024728059768677 Calling call_user_func: 0.062517881393433
Output for 5.3.2
Calling directly on object: 0.029674053192139 Calling call_user_func: 0.069471836090088
Output for 5.3.1
Calling directly on object: 0.024480104446411 Calling call_user_func: 0.056586027145386
Output for 5.3.0
Calling directly on object: 0.024349927902222 Calling call_user_func: 0.063483953475952
Output for 5.2.17
Calling directly on object: 0.032664060592651 Calling call_user_func: 0.085510015487671
Output for 5.2.16
Calling directly on object: 0.03369402885437 Calling call_user_func: 0.088443994522095
Output for 5.2.15
Calling directly on object: 0.030179977416992 Calling call_user_func: 0.080354928970337
Output for 5.2.14
Calling directly on object: 0.028393030166626 Calling call_user_func: 0.073365926742554
Output for 5.2.13
Calling directly on object: 0.025099039077759 Calling call_user_func: 0.070336103439331
Output for 5.2.12
Calling directly on object: 0.030154943466187 Calling call_user_func: 0.072273015975952
Output for 5.2.11
Calling directly on object: 0.030890941619873 Calling call_user_func: 0.073137044906616
Output for 5.2.10
Calling directly on object: 0.026957035064697 Calling call_user_func: 0.074534177780151
Output for 5.2.9
Calling directly on object: 0.021079063415527 Calling call_user_func: 0.064167022705078
Output for 5.2.8
Calling directly on object: 0.019867897033691 Calling call_user_func: 0.062740087509155
Output for 5.2.7
Calling directly on object: 0.033606052398682 Calling call_user_func: 0.079483032226562
Output for 5.2.6
Calling directly on object: 0.019521951675415 Calling call_user_func: 0.062358856201172
Output for 5.2.5
Calling directly on object: 0.033293008804321 Calling call_user_func: 0.09424901008606
Output for 5.2.4
Calling directly on object: 0.029152870178223 Calling call_user_func: 0.074970006942749
Output for 5.2.3
Calling directly on object: 0.03156590461731 Calling call_user_func: 0.085443019866943
Output for 5.2.2
Calling directly on object: 0.027148008346558 Calling call_user_func: 0.074464082717896
Output for 5.2.1
Calling directly on object: 0.034603118896484 Calling call_user_func: 0.092206001281738
Output for 5.2.0
Calling directly on object: 0.018532991409302 Calling call_user_func: 0.069946050643921
Output for 5.1.6
Calling directly on object: 0.02920389175415 Calling call_user_func: 0.075007915496826
Output for 5.1.5
Calling directly on object: 0.035459041595459 Calling call_user_func: 0.087378978729248
Output for 5.1.4
Calling directly on object: 0.031633138656616 Calling call_user_func: 0.080470085144043
Output for 5.1.3
Calling directly on object: 0.032498836517334 Calling call_user_func: 0.083884954452515
Output for 5.1.2
Calling directly on object: 0.033598899841309 Calling call_user_func: 0.082062959671021
Output for 5.1.1
Calling directly on object: 0.027462959289551 Calling call_user_func: 0.072439908981323
Output for 5.1.0
Calling directly on object: 0.034186840057373 Calling call_user_func: 0.084772109985352
Output for 5.0.5
Calling directly on object: 0.048937082290649 Calling call_user_func: 0.1047580242157
Output for 5.0.4
Calling directly on object: 0.061209917068481 Calling call_user_func: 0.10803008079529
Output for 5.0.3
Calling directly on object: 0.050919055938721 Calling call_user_func: 0.091353178024292
Output for 5.0.2
Calling directly on object: 0.061515092849731 Calling call_user_func: 0.11409497261047
Output for 5.0.1
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/oWDTc on line 20 Calling directly on object: 0.04714298248291PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/oWDTc on line 27 Calling call_user_func: 0.089324951171875PHP_EOL
Output for 5.0.0
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/oWDTc on line 20 Calling directly on object: 0.040663957595825PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/oWDTc on line 27 Calling call_user_func: 0.08747410774231PHP_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/oWDTc 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/oWDTc 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/oWDTc on line 5
Process exited with code 255.