开发者

Netbeans & Xdebug Problem: private variables in class methods not visible?

when I debug my PHP Project using Netbeans IDE 6.9.1 and Xdebug 2.0.5 variables declared in the scope of class methods like $myVar in the follo开发者_运维技巧wing example are not visible in the variables-window :

class Test
{
  public function test($myVar)
  {
     return $myVar=1+$myVar;
  }

}

Though Object-Variables and SuperGlobals are visible.

This is a very annoying behavior as the values of these variables are often important hints for finding bugs.

Is someone facing the same problem?

Is this a normal behavior of XDebug or do I have to change the configuration?

Thanks for any help or hints.


You could turn on Watches/Balloons Evaluation in Tools, Options, PHP. But xdebug tends to get unstable when you do that on a large project.


Found this link to solve my issue:

Basically it is a problem with XDebug 2.0.5 and PHP 5.3.2.

To solve this just upgrade to XDebug 2.1.0.


I use Eclipse and local vars are shown, of course given your debug-location is within the variables local scope.

It also isn't related to show_local_vars and collect_params, as I disabled both (confiremd by phpinfo) and Eclipse still keeps track of local variables.

So ... Iam not facing the same problem and it dosn't seem to be the 'normal' behaviour of XDebug and it doesn't seem to be related to your XDebug-settings.


I accidentally used a quoted value in my apache php.ini and was only able to retrieve the superglobals values which led me to believe the debugger was actually working. Apparently you have to use the unquoted value because now I can also see the local variables.

So instead of

zend_extension = "/usr/lib/php5/20090626/xdebug.so"

Use

zend_extension = /usr/lib/php5/20090626/xdebug.so

Ubuntu 10.04 PHP 5.3.2 Netbeans 7.1.2 Xdebug 2.2.1

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜