Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

phpStorm/Xdebug can't show show child arrays of objects

I'm trying to debug this code:

  public function removeBlankLines() {
    $this->qp->find('br');
  } // <-- break point is here

When I drill down into the $this object (using phpStorm) I can't see the child array I'm interested in. It just displays "can not get property" Screenshot:

phpStorm debug pane screenshot

I'm "listen for debug connections" feature. I'm running the script from the command line. PHP version:

[bwood@mbp ~]$ php -v
PHP 5.4.24 (cli) (built: Jan 19 2014 21:32:15)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies
with Xdebug v2.2.3, Copyright (c) 2002-2013, by Derick Rethans

Maybe related: http://bugs.xdebug.org/view.php?id=996?

like image 370
Brian Wood Avatar asked Apr 23 '14 17:04

Brian Wood


People also ask

Why is Xdebug not working?

When the debugger cannot connect or refuses the connection, check the following: Make sure Xdebug or Zend Debugger are configured to connect to the host and port PhpStorm is running on. In the Xdebug configuration, make sure xdebug. remote_host and xdebug.

How do I know if Xdebug is running?

Verify that Xdebug is properly running by checking again with phpinfo() or php -v as explained above. Note that 9003 is the default port. If this port is used by another service on your system, change it to an unused port. After adding these settings, restart your webserver again.


1 Answers

http://bugs.xdebug.org/view.php?id=686

It's all about how such classes (SplObjectStorage, ArrayObject and alike) are implemented internally:

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 nothing can be done on PhpStorm's side until xdebug will be able to "support" them.


UPDATE: The aforementioned xdebug ticket was resolved for xdebug 2.3.3 quite some time ago (latest stable xdebug version is 2.4.1) and it should be possible to view such classes in debugger.

like image 86
LazyOne Avatar answered Oct 15 '22 16:10

LazyOne