xdebug中的php var_dump()忽略__debuginfo()魔法方法
当使用var_dump()
时,Xdebug似乎忽略了php魔法方法debuginfo()
。
注射依赖关系(带有依赖关系,依赖关系...)时,这尤其不合时宜。
是否有Xdebug的var_dump()
的设置,因此可以按预期与debuginfo()
一起使用?还是PHP中的解决方法?我找不到任何东西。
Xdebug seems to ignore PHP magic method __debugInfo()
in user defined classes when using var_dump()
.
This is especially unhandy when injecting dependencies (with dependencies, with dependencies...).
Is there a setting for Xdebug's var_dump()
so it works with __debugInfo()
as expected? Or a workaround in PHP maybe? I could not find anything.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Xdebug的理念是显示对象中存在的数据,以帮助调试。显示所有属性,而不仅仅是
__ debuginfo()
返回的属性。有一个用于步骤调试的方法代码> var_dump()。您可以关闭Xdebug的“开发工具”,但是,不在
xdebug.mode
php.ini设置中不包括开发
。Xdebug's philosophy is to show data as it exists in objects, to aid debugging. Having all the properties shown, and not just the ones that
__debugInfo()
returns follows this convention.There is a workaround for step debugging, but not for the overloaded
var_dump()
. You can turn off Xdebug's "Development Tools" however, by not includingdevelop
in thexdebug.mode
php.ini setting.