鉴于以下代码,我正在寻找调用 $this->myStaticFunc(); 的优点和缺点;与自我::myStaticFunc();
class MyClass
private function myPrivateFunc() {
...
$this->myStaticFunc(); // or self::myStaticFunc();
...
}
// no need to tell me that i can't use $this in here
public static function myStaticFunc() { ... }
}
// access static function
MyClass::myStaticFunc();