跌落尘层的王者
2014-10-19 14:18
<?php
header('Content-type: text/html; charset=utf8');
function current_time(){
list( $usec ,$sec) = explode(" ", microtime());
return ((float)$usec + (float)$sec);
}
class Test{
public $var = "123";
public function __get($varname){
return $this->var;
}
}
$start = current_time();
$i = 0;
while ($i<10000) {
$i++;
$test = new Test();
$test->var;
}
$end = current_time();
echo "Lost Time: ". number_format($end - $start,3)*1000;
echo "\n";
?>还没有人回答问题,可以看看其他问题
性能优化之PHP优化
37099 学习 · 109 问题
相似问题