3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class Foo { public function do_foo($one, $two, $three) {} } class Bar { private $methods; public function __construct() { $this->methods['do_foo'] = function($one, $two, $three) {}; } public function __call($name, $args) { call_user_func_array($this->methods[$name], $args); } } $rounds = 100000; $tests = [new Foo(), new Bar()]; foreach ($tests as $test) { echo get_class($test), "\n"; $time = -microtime(true); for ($i = 0; $i < $rounds; ++$i) { $test->do_foo(1, 2, 3); } $time += microtime(true); echo "$time msecs\n"; }
Output for 7.1.0
Foo 0.0078749656677246 msecs Bar 0.023494958877563 msecs
Output for 7.0.14
Foo 0.0068278312683105 msecs Bar 0.026701927185059 msecs
Output for 7.0.8
Foo 0.0037720203399658 msecs Bar 0.017409086227417 msecs
Output for 7.0.7
Foo 0.0039339065551758 msecs Bar 0.019384860992432 msecs
Output for 7.0.6
Foo 0.0032479763031006 msecs Bar 0.015673875808716 msecs
Output for 7.0.5
Foo 0.0032248497009277 msecs Bar 0.016094923019409 msecs
Output for 7.0.4
Foo 0.0033528804779053 msecs Bar 0.015835046768188 msecs
Output for 7.0.3
Foo 0.0046918392181396 msecs Bar 0.022200107574463 msecs
Output for 7.0.2
Foo 0.005640983581543 msecs Bar 0.022342920303345 msecs
Output for 7.0.1
Foo 0.0044889450073242 msecs Bar 0.021528959274292 msecs
Output for 7.0.0
Foo 0.0034599304199219 msecs Bar 0.016313076019287 msecs
Output for hhvm-3.12.0
Foo 0.018354892730713 msecs Bar 0.039796829223633 msecs
Output for hhvm-3.10.0
Foo 0.024490118026733 msecs Bar 0.05063009262085 msecs
Output for 5.6.28
Foo 0.029598951339722 msecs Bar 0.11883401870728 msecs
Output for 5.6.23
Foo 0.019484043121338 msecs Bar 0.10940313339233 msecs
Output for 5.6.22
Foo 0.016649961471558 msecs Bar 0.10120987892151 msecs
Output for 5.6.21
Foo 0.01677680015564 msecs Bar 0.099446058273315 msecs
Output for 5.6.20
Foo 0.015773057937622 msecs Bar 0.1014940738678 msecs
Output for 5.6.19
Foo 0.01989483833313 msecs Bar 0.10985493659973 msecs
Output for 5.6.18
Foo 0.021826028823853 msecs Bar 0.10721516609192 msecs
Output for 5.6.17
Foo 0.019423961639404 msecs Bar 0.10930204391479 msecs
Output for 5.6.16
Foo 0.019227027893066 msecs Bar 0.10691094398499 msecs
Output for 5.6.15
Foo 0.015122175216675 msecs Bar 0.10084795951843 msecs
Output for 5.6.14
Foo 0.022852897644043 msecs Bar 0.11013197898865 msecs
Output for 5.6.13
Foo 0.018121004104614 msecs Bar 0.10661315917969 msecs
Output for 5.6.12
Foo 0.014157056808472 msecs Bar 0.095916986465454 msecs
Output for 5.6.11
Foo 0.020344018936157 msecs Bar 0.10008192062378 msecs
Output for 5.6.10
Foo 0.018326997756958 msecs Bar 0.099209070205688 msecs
Output for 5.6.9
Foo 0.023226022720337 msecs Bar 0.10577702522278 msecs
Output for 5.6.8
Foo 0.019800901412964 msecs Bar 0.10561013221741 msecs
Output for 5.6.7
Foo 0.023684978485107 msecs Bar 0.12459087371826 msecs
Output for 5.6.6
Foo 0.022163152694702 msecs Bar 0.11596417427063 msecs
Output for 5.6.5
Foo 0.020162105560303 msecs Bar 0.10246706008911 msecs
Output for 5.6.4
Foo 0.01830792427063 msecs Bar 0.10471892356873 msecs
Output for 5.6.3
Foo 0.014603853225708 msecs Bar 0.096518039703369 msecs
Output for 5.6.2
Foo 0.018587827682495 msecs Bar 0.10597586631775 msecs
Output for 5.6.1
Foo 0.014645099639893 msecs Bar 0.097430944442749 msecs
Output for 5.6.0
Foo 0.018783092498779 msecs Bar 0.10184192657471 msecs
Output for 5.5.37
Foo 0.019459009170532 msecs Bar 0.10867500305176 msecs
Output for 5.5.36
Foo 0.017750978469849 msecs Bar 0.10070085525513 msecs
Output for 5.5.35
Foo 0.0227210521698 msecs Bar 0.11084198951721 msecs
Output for 5.5.34
Foo 0.028813123703003 msecs Bar 0.13522005081177 msecs
Output for 5.5.33
Foo 0.020162105560303 msecs Bar 0.11642003059387 msecs
Output for 5.5.32
Foo 0.014663934707642 msecs Bar 0.098198175430298 msecs
Output for 5.5.31
Foo 0.014841794967651 msecs Bar 0.097012042999268 msecs
Output for 5.5.30
Foo 0.013165950775146 msecs Bar 0.086678028106689 msecs
Output for 5.5.29
Foo 0.017745018005371 msecs Bar 0.10067105293274 msecs
Output for 5.5.28
Foo 0.022509098052979 msecs Bar 0.12016296386719 msecs
Output for 5.5.27
Foo 0.023924112319946 msecs Bar 0.12467503547668 msecs
Output for 5.5.26
Foo 0.023796796798706 msecs Bar 0.11176204681396 msecs
Output for 5.5.25
Foo 0.017516136169434 msecs Bar 0.10041189193726 msecs
Output for 5.5.24
Foo 0.014456987380981 msecs Bar 0.098298072814941 msecs
Output for 5.5.23
Foo 0.014317989349365 msecs Bar 0.096551895141602 msecs
Output for 5.5.22
Foo 0.018400907516479 msecs Bar 0.1063711643219 msecs
Output for 5.5.21
Foo 0.017491817474365 msecs Bar 0.10448884963989 msecs
Output for 5.5.20
Foo 0.019062042236328 msecs Bar 0.10806202888489 msecs
Output for 5.5.19
Foo 0.017055034637451 msecs Bar 0.10264015197754 msecs
Output for 5.5.18
Foo 0.024255990982056 msecs Bar 0.12581706047058 msecs
Output for 5.5.16
Foo 0.021736860275269 msecs Bar 0.10698390007019 msecs
Output for 5.5.15
Foo 0.021328926086426 msecs Bar 0.11613082885742 msecs
Output for 5.5.14
Foo 0.017428159713745 msecs Bar 0.098847150802612 msecs
Output for 5.5.13
Foo 0.015925884246826 msecs Bar 0.097667932510376 msecs
Output for 5.5.12
Foo 0.024955987930298 msecs Bar 0.13030099868774 msecs
Output for 5.5.11
Foo 0.020583868026733 msecs Bar 0.10668992996216 msecs
Output for 5.5.10
Foo 0.014134883880615 msecs Bar 0.095821857452393 msecs
Output for 5.5.9
Foo 0.020741939544678 msecs Bar 0.10765600204468 msecs
Output for 5.5.8
Foo 0.017983913421631 msecs Bar 0.10676002502441 msecs
Output for 5.5.7
Foo 0.020101070404053 msecs Bar 0.10236406326294 msecs
Output for 5.5.6
Foo 0.014654159545898 msecs Bar 0.096872091293335 msecs
Output for 5.5.5
Foo 0.019493103027344 msecs Bar 0.11350584030151 msecs
Output for 5.5.4
Foo 0.020451068878174 msecs Bar 0.11216878890991 msecs
Output for 5.5.3
Foo 0.016350984573364 msecs Bar 0.097572088241577 msecs
Output for 5.5.2
Foo 0.018518924713135 msecs Bar 0.10747408866882 msecs
Output for 5.5.1
Foo 0.014451026916504 msecs Bar 0.097662925720215 msecs
Output for 5.5.0
Foo 0.023023843765259 msecs Bar 0.1174750328064 msecs
Output for 5.4.45
Foo 0.018599033355713 msecs Bar 0.10589790344238 msecs
Output for 5.4.44
Foo 0.019380807876587 msecs Bar 0.10522294044495 msecs
Output for 5.4.43
Foo 0.019160032272339 msecs Bar 0.10184383392334 msecs
Output for 5.4.42
Foo 0.019476890563965 msecs Bar 0.09512186050415 msecs
Output for 5.4.41
Foo 0.019659042358398 msecs Bar 0.10630416870117 msecs
Output for 5.4.40
Foo 0.02301287651062 msecs Bar 0.12171506881714 msecs
Output for 5.4.39
Foo 0.018101930618286 msecs Bar 0.098542928695679 msecs
Output for 5.4.38
Foo 0.023942947387695 msecs Bar 0.10868501663208 msecs
Output for 5.4.37
Foo 0.015305995941162 msecs Bar 0.095327854156494 msecs
Output for 5.4.36
Foo 0.014302015304565 msecs Bar 0.097628831863403 msecs
Output for 5.4.35
Foo 0.019279003143311 msecs Bar 0.10557913780212 msecs
Output for 5.4.34
Foo 0.023173093795776 msecs Bar 0.12357211112976 msecs
Output for 5.4.32
Foo 0.020318984985352 msecs Bar 0.1100709438324 msecs
Output for 5.4.31
Foo 0.020798921585083 msecs Bar 0.10549688339233 msecs
Output for 5.4.30
Foo 0.024040937423706 msecs Bar 0.12315392494202 msecs
Output for 5.4.29
Foo 0.020053148269653 msecs Bar 0.11114597320557 msecs
Output for 5.4.28
Foo 0.023133993148804 msecs Bar 0.12269496917725 msecs
Output for 5.4.27
Foo 0.021095991134644 msecs Bar 0.10881614685059 msecs
Output for 5.4.26
Foo 0.014744997024536 msecs Bar 0.097010135650635 msecs
Output for 5.4.25
Foo 0.022893190383911 msecs Bar 0.10139989852905 msecs
Output for 5.4.24
Foo 0.02236795425415 msecs Bar 0.099800825119019 msecs
Output for 5.4.23
Foo 0.014776945114136 msecs Bar 0.095409870147705 msecs
Output for 5.4.22
Foo 0.0157790184021 msecs Bar 0.095428943634033 msecs
Output for 5.4.21
Foo 0.015769004821777 msecs Bar 0.097311019897461 msecs
Output for 5.4.20
Foo 0.017477035522461 msecs Bar 0.10058093070984 msecs
Output for 5.4.19
Foo 0.014954090118408 msecs Bar 0.10138201713562 msecs
Output for 5.4.18
Foo 0.014307022094727 msecs Bar 0.096258878707886 msecs
Output for 5.4.17
Foo 0.022599935531616 msecs Bar 0.11020088195801 msecs
Output for 5.4.16
Foo 0.017262935638428 msecs Bar 0.099746942520142 msecs
Output for 5.4.15
Foo 0.020236968994141 msecs Bar 0.10151290893555 msecs
Output for 5.4.14
Foo 0.017514944076538 msecs Bar 0.099918842315674 msecs
Output for 5.4.13
Foo 0.015629053115845 msecs Bar 0.097240924835205 msecs
Output for 5.4.12
Foo 0.017755031585693 msecs Bar 0.10149002075195 msecs
Output for 5.4.11
Foo 0.020305156707764 msecs Bar 0.10705399513245 msecs
Output for 5.4.10
Foo 0.019190073013306 msecs Bar 0.11172413825989 msecs
Output for 5.4.9
Foo 0.019367933273315 msecs Bar 0.1139931678772 msecs
Output for 5.4.8
Foo 0.016065120697021 msecs Bar 0.095458984375 msecs
Output for 5.4.7
Foo 0.016519069671631 msecs Bar 0.096737861633301 msecs
Output for 5.4.6
Foo 0.024019956588745 msecs Bar 0.12539410591125 msecs
Output for 5.4.5
Foo 0.014302015304565 msecs Bar 0.09514594078064 msecs
Output for 5.4.4
Foo 0.023500919342041 msecs Bar 0.12478709220886 msecs
Output for 5.4.3
Foo 0.014656782150269 msecs Bar 0.094720840454102 msecs
Output for 5.4.2
Foo 0.019477128982544 msecs Bar 0.10911107063293 msecs
Output for 5.4.1
Foo 0.020727157592773 msecs Bar 0.11690092086792 msecs
Output for 5.4.0
Foo 0.014689922332764 msecs Bar 0.096973896026611 msecs
Output for 5.3.0 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/TQHHo on line 21
Process exited with code 255.
Output for 5.1.0 - 5.2.17
Parse error: syntax error, unexpected T_FUNCTION in /in/TQHHo on line 11
Process exited with code 255.
Output for 5.0.0 - 5.0.5
Parse error: parse error, unexpected T_FUNCTION in /in/TQHHo on line 11
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/TQHHo 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/TQHHo 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/TQHHo on line 4
Process exited with code 255.