- microtime: documentation ( source)
- round: documentation ( source)
<?php
class foo {
public static function bar($x,$y){
return $x*y;
}
}
$s = microtime(true);
$met = 'bar';
for($x = 0; $x < 100000; $x++ ){
call_user_func(array('foo', $met), 10,20);
}
echo round(microtime(true) - $s,5)."\n";
$s = microtime(true);
$met = 'bar';
for($x = 0; $x < 100000; $x++ ){
foo::{$bar}(10,20);
}
echo round(microtime(true) - $s,5)."\n";