<?php
set_time_limit(0);
require_once "Benchmark/Timer.php";
class Test {
function nostat() {
return 99 * 99;
}
static function isstat() {
return 99 * 99;
}
static function stataa() {
return self::nostat();
}
static function statbb() {
return self::isstat();
}
}
$timer = new Benchmark_Timer(TRUE);
$timer->start();
$timer->setMarker('startNotStatic');
for ($i = 0; $i < 1000000; $i++) {
Test::nostat();
}
$timer->setMarker('endNotStatic');
$timer->setMarker('startIsStatic');
for ($i = 0; $i < 1000000; $i++) {
Test::isstat();
}
$timer->setMarker('endIsStatic');
$timer->setMarker('startstataa');
for ($i = 0; $i < 1000000; $i++) {
Test::isstat();
}
$timer->setMarker('endstataa');
$timer->setMarker('startstatbb');
for ($i = 0; $i < 1000000; $i++) {
Test::isstat();
}
$timer->setMarker('endstatbb');
$timer->stop();
$timer->display();