<?php
//lets say one of these files have the function test();
include 'a.php';
include 'b.php';
include 'c.php';
include 'd.php';
test();
?>
如何找出调用哪个文件和行函数test()? (不打开文件)谢谢
答案 0 :(得分:1)
您可以使用reflection with PHP:
$func = new ReflectionFunction('test');
echo $func->getFileName();
echo $func->getStartLine();