@Chiang
2020-01-08T03:13:26.000000Z
字数 317
阅读 781
PHP
get_called_class — 后期静态绑定("Late Static Binding")类的名称
get_called_class ( void ) : string
获取静态方法调用的类名。
返回类的名称,如果不是在类中调用则返回 FALSE。
<?phpclass foo {static public function test() {var_dump(get_called_class());}}class bar extends foo {}foo::test();bar::test();以上例程会输出:string(3) "foo"string(3) "bar"?>
