如下所示:
';
}
static public function eat(){
echo '静态方法吃饭
';
}
public function intro(){
echo $this->name;
}
}
Error_reporting(E_ALL|E_STRICT);
//此时没有对象!方法可以执行
Human::eat();
Human::easyeat();
Human::intro();
$li=new Human();
$li->eat();
?>
以上就是小编为大家带来的详谈php静态方法及普通方法的区别全部内容了,希望大家多多支持考高分网~



