class Test {
public function func () {
return 'hello';
}
public static function action () {
// 如何调用 func 方法 ?
}
}
class Test {
public function func () {
return 'hello';
}
public static function action () {
// 如何调用 func 方法 ?
}
}
可以使用 self::func
但是在高版本php中已经过时了,
Deprecated: Non-static method Test::func() should not be called statically in ……
建议使用(new self())->func();