Netbeans 和Xdebug 问题:类方法中的私有变量不可见?
当我使用 Netbeans IDE 6.9.1 和 Xdebug 2.0.5 调试 PHP 项目时,在类方法范围内声明的变量(例如以下示例中的 $myVar)在变量窗口中不可见
class Test
{
public function test($myVar)
{
return $myVar=1+$myVar;
}
}
: -变量和超级全局是可见的。
这是一种非常烦人的行为,因为这些变量的值通常是查找错误的重要提示。
有人面临同样的问题吗?
这是 XDebug 的正常行为还是我必须更改配置?
感谢您的任何帮助或提示。
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 following 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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
您可以在“工具”、“选项”、“PHP”中打开手表/气球评估。但是,当您在大型项目中执行此操作时,xdebug 往往会变得不稳定。
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.
找到这个链接 解决我的问题:
基本上这是 XDebug 2.0.5 和 PHP 5.3.2 的问题。
要解决此问题,只需升级到 XDebug 2.1.0。
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.
我使用 Eclipse 并显示本地变量,当然前提是您的调试位置位于变量本地范围内。
它也与 show_local_vars 和collect_params 无关,因为我禁用了两者(由 phpinfo 确认)并且 Eclipse 仍然跟踪局部变量。
所以...我没有遇到同样的问题,它似乎不是 XDebug 的“正常”行为,而且它似乎与您的 XDebug 设置无关。
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.
我不小心在我的 apache php.ini 中使用了引用值,并且只能检索超全局值,这让我相信调试器实际上正在工作。
显然你必须使用不带引号的值,因为现在我还可以看到局部变量。
所以不要
使用
Ubuntu 10.04
PHP 5.3.2
网豆 7.1.2
X调试2.2.1
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
Use
Ubuntu 10.04
PHP 5.3.2
Netbeans 7.1.2
Xdebug 2.2.1