当前位置: 代码迷 >> 综合 >> 函数 get_called_class 获取静态调用的类名
  详细解决方案

函数 get_called_class 获取静态调用的类名

热度:76   发布时间:2023-10-11 01:30:48.0
<?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"