【phpstudy】php 使用反射获取类的文件路径

更新时间:2019-05-13    来源:php常用代码    手机版     字体:

【www.bbyears.com--php常用代码】

 代码如下

$pc_base =new pc_base();
$object = new ReflectionObject($pc_base);
//load_app_class 是类中的一个方法

$method = $object->getMethod("load_app_class");
$declaringClass = $method->getDeclaringClass();
$filename = $declaringClass->getFilename();
print_r($filename);
 
?>

本文来源:http://www.bbyears.com/jiaocheng/50917.html

猜你感兴趣

热门标签

更多>>

本类排行