我爱占星网 我爱占星网
首页
编程
java
php
前端
首页 编程 java php 前端

获取在php上调用的文件和行?

<?php
//lets say one of these files have the function test();
include 'a.php';
include 'b.php';
include 'c.php';
include 'd.php';

test();
?>

How can I find out which file and line function test() is being called at? (without opening the files) Thanks

You can use reflection with PHP :

$func = new ReflectionFunction('test');
echo $func->getFileName();
echo $func->getStartLine();

近期文章

  • PHP SQL代码未插入数据库
  • 在javascript中捕获php mysql变量
  • Laravel 4 Eloquent paginate相关模型
  • 用PHP计算Summer / Winter Solstice?
  • php的IF中的括号和赋值
  • PHP - 如何将变量实现到地址[关闭]
  • 通过值从三个数组中获得差异
  • MySQL事务超时多长时间
  • PHP $ array [] = $内容不能正常工作
  • PHP - 不在对象上下文中时使用$ this
  • 在cakephp中保存数据之间的区别
  • 如果我使用通配符,glob只能拉数组
  • 多个REGEX值在SQL中不起作用
  • 管理单身人士最好的方法是什么?
  • 验证字符串是否为FQDN(Codeigniter)
  • php://输入只能在根目录下工作
  • 使用PHP删除文件夹中的所有文件?
  • 如何使用Laravel发出删除请求
  • 将变量传递给PHP函数范围
  • 使用PHP从MSSQL中检索希腊字符

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

部分图文来自网络,如有侵犯您的版权,请告诉我们删除

友情链接:代码精华