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.
有没有办法找出脚本中使用了哪些内部 PHP 函数?
<?php echo "Hi"; $x = substr("hello",3);
目标是得到:echo, substr
get_defined_functions 显示所有全局可用,但我如何才能在脚本中只找到使用的?
解析文件不是我想要的。
您可以使用 XDebug 分析器查看脚本中执行了哪些函数以及执行了多少次。但它会收集所有功能执行(系统和自定义),我不记得它是否可以以某种方式过滤。
我并不是要打破你的泡沫,但解析可能是你最好的选择。您不会在 eval'd 代码中捕获函数调用 -eval等call_user_func。
eval
call_user_func
我很好奇你为什么要这样做。你能描述一下你的用例吗?