【转】PHP通过类名查找这个类所在的文件 路径 class counter { static $c = 0; return $c++; } Create an instance of the Reflection_Function class $func = new ReflectionClass('counter'); echo $func->getFileName();