1

我正在使用 Eclipse PDT 逐步执行代码。当我将鼠标悬停在一个数组上时,它会显示例如“$_SESSION = Array [0]”,但不会向我显示数据。

这对于本地变量来说很好,因为我可以在“变量”窗口中看到它们,但这意味着我看不到 $_GET、$_POST、$_SESSION 的内容。

我该如何解决?

4

4 回答 4

1

In the editor, when I right-click a variable name during a debug session there are choices "Inspect" and "Watch" in the menu.

I took me a while to find out that to enable those choices I had to select the variable name in the editor before right-clicking. You could also press Ctrl+Shift+I for "Inspect".

"Inspect" opens a content assist window with expandable variable content.

"Watch" will add the variable to the "Expressions" view.

"Variables" view contains all variables in the debug context with expandable content.

It would be nice with a condensed json-like one-line display format for arrays and object variables to see the contents of complex variables at a glance, but I have not found a way to do that yet.

I'm currently using Eclipse 3.6 Helios SR1, Xdebug 2.1.0, PHP 5.3.0, Wamp server

于 2010-10-14T13:57:52.917 回答
1

假设您使用的是 xdebug。

如果您查看“变量”窗口,它还会列出您提到的那些超全局数组(_SESSION、_POST、...)。如果您没有看到它们,请尝试升级 xdebug。对于这个区域(调试期间的变量),我发现它确实有问题。

于 2010-05-25T13:58:04.110 回答
0

这是一个 XDebug 配置设置问题。

要解决: 转到Debug Configurations -> 选择您的 Debug Configuration -> 单击“Debugger”选项卡-> 单击Server Debugger“Configure”

在此配置窗口中,有一个“在变量视图中显示超级全局变量”选项。确保启用此配置选项,因为 $_POST 数组是 PHP 固有的超级全局变量之一。

现在,当您运行调试会话时,所有超级全局变量都将在“变量”窗口中可用。这包括 $_POST、$_GET、$_COOKIE 等。

于 2013-09-11T14:18:32.700 回答
0

每个数组的左侧都有一个小箭头。单击此按钮可展开列表以显示值。

于 2010-05-27T03:41:41.360 回答