[英]Debugging of object of DOMXPath and DOMDocument
We use echo or print_r
to get value of variables while debugging PHP code.我们在调试 PHP 代码时使用 echo 或print_r
来获取变量的值。
But, object of DOMXPath or DOMDocument are not captured in echo
or print_r
.但是, DOMXPath 或 DOMDocument 的对象不会在echo
或print_r
捕获。
How to get values from above objects while debugging PHP code?调试PHP代码时如何从上述对象中获取值?
This is a bug:这是一个错误:
For some reason, DOM*
classes do not expose their properties, neither to Reflection, nor to any other function capable of inspecting objects.出于某种原因, DOM*
类既不向反射也不向任何其他能够检查对象的函数公开其属性。 You'd have to write a custom inspector that collects the properties manually.您必须编写一个自定义检查器来手动收集属性。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.