- microtime: documentation ( source)
- round: documentation ( source)
- is_callable: documentation ( source)
- method_exists: documentation ( source)
<?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";