我试图调试这个代码:
- public function removeBlankLines() {
- $this->qp->find('br');
- } // <-- break point is here
当我深入到$this对象(使用PHPStorm)我看不到我感兴趣的子数组,它只显示“无法获得属性”屏幕截图:
我正在“侦听调试连接”功能.我从命令行运行脚本. PHP版本:
http://bugs.xdebug.org/view.php?id=686
关于如何在内部实现这样的类(SplObjectStorage,ArrayObject和类似):
this is because objects of the class SplObjectStorage are not user land PHP objects but special super duper internal ones. A similar situation will happen with many other internal PHP classes.
AFAIK在PHPStorm的一边就可以完成任务,直到xdebug能够“支持”它们.
更新:前面提到的xdebug ticket已经解决了xdebug 2.3.3(最新的稳定的xdebug版本是2.4.1),应该可以在调试器中查看这样的类.