class me {
private $name;
public function __construct($name) { $this->name = $name; }
public function work() {
return "You are working as ". $this->name;
}
public static function work() {
return "You are working anonymously";
}
}
$new = new me();
me::work();
致命错误:无法重新声明我::work()
问题是,为什么 php 不允许像这样重新声明。有什么解决方法吗?