测试.php
<?php
$cache = new cache();
echo $cache->getcache('test.php');
?>
cache.class.php 文件
<?php
class cache extends saemc{
var $db;
function cache(){
$this->db=$db;
}
function getcache($cachename){
return $this->getvalue($cachename);
}
?>
saemc.class.php 文件
<?php
class saemc {
static $handler;
protected function getvalue($filename) {
$content = $this->handler->get($filename);//this incorrect line
......
}
?>
为什么 $handler 使用“静态”修饰符,但 $this->handler 仍然是非对象?