Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在分析一个应用程序,该应用程序在许多文件中都有大量函数,并且我正在尝试隔离那些永远不会被调用的函数。
在我继续之前有什么想法吗?
我不相信有一种简单的方法可以做到这一点。print_r(get_defined_functions());在可以包含在每个文件末尾或全局文件中的文件中。收集输出并搜索所有文件以查找函数调用。这将隔离您的功能。
print_r(get_defined_functions());
或者
将所有函数移至包含文件,注释掉函数,然后允许应用程序出错。当您收到这些函数的错误时,请取消注释这些函数以解决错误。在所有检查结束时,您将获得一个未使用的注释功能列表。
无论哪种方式都不容易。