由于您不能在静态函数中使用 $this->,您应该如何访问静态函数中的常规函数?
private function hey()
{
return 'hello';
}
public final static function get()
{
return $this->hey();
}
这会引发错误,因为您不能在静态中使用 $this->。
private function hey()
{
return 'hello';
}
public final static function get()
{
return self::hey();
}
这会引发以下错误:
Non-static method Vote::get() should not be called statically
如何访问静态方法中的常规方法?在同一个班*