3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class foo { public static function bar($x,$y){ return $x*$y; } public static function met1(){ $met = $bar; //return static:: } } $s = microtime(true); for($x = 0; $x < 10000; $x++ ){ $a = is_callable(array('foo', 'bar')); } echo round(microtime(true) - $s,5)."\n"; $s = microtime(true); for($x = 0; $x < 10000; $x++ ){ $a = method_exists('foo', 'bar'); } echo round(microtime(true) - $s,5)."\n"; $s = microtime(true); $met = array('foo', 'bar'); for($x = 0; $x < 10000; $x++ ){ $a = $met instanceof \Callable; } echo round(microtime(true) - $s,5)."\n";
Output for 5.4.0 - 5.4.17
Parse error: syntax error, unexpected 'Callable' (T_CALLABLE), expecting identifier (T_STRING) in /in/KrCjN on line 30
Process exited with code 255.
Output for 5.3.29
0.00533 0.00265 0.00092
Output for 5.3.28
0.00693 0.00497 0.00136
Output for 5.3.27
0.00509 0.00277 0.00111
Output for 5.3.26
0.00474 0.00268 0.00091
Output for 5.3.25
0.00507 0.00286 0.00098
Output for 5.3.24
0.00493 0.0033 0.00114
Output for 5.3.23
0.00496 0.00307 0.00093
Output for 5.3.22
0.00456 0.0032 0.00093
Output for 5.3.21
0.00544 0.00301 0.0009
Output for 5.3.20
0.00492 0.00305 0.00096
Output for 5.3.19
0.00457 0.00317 0.0009
Output for 5.3.18
0.00446 0.00286 0.0009
Output for 5.3.17
0.00615 0.00297 0.0009
Output for 5.3.16
0.00562 0.00327 0.00101
Output for 5.3.15
0.00492 0.00338 0.0009
Output for 5.3.14
0.00527 0.00302 0.00103
Output for 5.3.13
0.00451 0.00302 0.00092
Output for 5.3.12
0.00449 0.00296 0.00094
Output for 5.3.11
0.00442 0.00305 0.00099
Output for 5.3.10
0.00528 0.00284 0.00109
Output for 5.3.9
0.00531 0.00373 0.00127
Output for 5.3.8
0.00473 0.00293 0.00095
Output for 5.3.7
0.00469 0.00294 0.00111
Output for 5.3.6
0.00492 0.00288 0.00093
Output for 5.3.5
0.0045 0.0031 0.00095
Output for 5.3.4
0.00492 0.00293 0.001
Output for 5.3.3
0.00502 0.00325 0.00098
Output for 5.3.2
0.00466 0.00308 0.00114
Output for 5.3.1
0.00453 0.00302 0.00094
Output for 5.3.0
0.00461 0.00318 0.00114