- microtime: documentation ( source)
<?php
class Aself {
protected static function g0() {
}
public static function get() {
return self::g0();
}
}
class Astatic {
protected static function g0() {
}
public static function get() {
return static::g0();
}
}
$t = microtime(true);
for ($i = 0; $i < 10000; $i++) {
Aself::get();
}
echo microtime(true) - $t;
echo "\n";
$t = microtime(true);
for ($i = 0; $i < 10000; $i++) {
Astatic::get();
}
echo microtime(true) - $t;
echo "\n";