Last updated 2 years ago
本来原题有提示扫描源码,有个不常见的源码文件index.php.swo。
然后说文件里面还有什么,这里指的是注释,所以使用PHP一个原生类,读取文件注释。
$method = new ReflectionMethod('User', 'b'); var_dump($method->getDocComment());
类ReflectionMethod('User', 'b')实例化User类的b方法。
getDocComment读取注释。