我正在尝试使用以下函数循环加载文件并查找折旧函数。
//loads all files
include dirname(__FILE__) . '/loader.php';
$functions = get_defined_functions();
foreach ($functions['user'] as $func) {
$rf = new ReflectionFunction('$func');
var_dump($rf->isDeprecated());
}
有些函数有如下标记,但它仍然是 return false
。事实上,每个函数都会返回false
,但还有很多带有标记的声明@deprecated
。
**
*
* @since 0.71
* @deprecated 1.5.1
* @deprecated Use get_post()
*
* @param int $postid
* @return array
*/
参考:http ://www.php.net/manual/en/class.reflectionfunction.php