3v4l.org

run code in 300+ PHP versions simultaneously
<?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.03613 0.00288 0.0011
Output for 5.3.26
0.00469 0.0028 0.00093
Output for 5.3.25
0.00513 0.00316 0.00094
Output for 5.3.24
0.00495 0.00281 0.00107
Output for 5.3.23
0.00502 0.00329 0.00094
Output for 5.3.22
0.00461 0.003 0.00093
Output for 5.3.21
0.00503 0.00311 0.00093
Output for 5.3.20
0.00496 0.00336 0.00093
Output for 5.3.19
0.00449 0.00293 0.00089
Output for 5.3.18
0.00522 0.00291 0.0009
Output for 5.3.17
0.00538 0.00295 0.0009
Output for 5.3.16
0.00599 0.00322 0.00093
Output for 5.3.15
0.00485 0.00363 0.00091
Output for 5.3.14
0.00735 0.00396 0.00089
Output for 5.3.13
0.00454 0.00361 0.001
Output for 5.3.12
0.00456 0.00297 0.00092
Output for 5.3.11
0.00442 0.00291 0.00089
Output for 5.3.10
0.00465 0.00284 0.00106
Output for 5.3.9
0.0056 0.00289 0.00095
Output for 5.3.8
0.00462 0.00292 0.00101
Output for 5.3.7
0.00543 0.00309 0.00113
Output for 5.3.6
0.00493 0.00294 0.00094
Output for 5.3.5
0.00444 0.00365 0.00139
Output for 5.3.4
0.00517 0.003 0.00099
Output for 5.3.3
0.00524 0.00317 0.00095
Output for 5.3.2
0.00464 0.00313 0.00113
Output for 5.3.1
0.00462 0.00299 0.00096
Output for 5.3.0
0.00474 0.0031 0.00131

preferences:
68.38 ms | 401 KiB | 53 Q