当前位置: 动力学知识库 > 问答 > 编程问答 >

Netbeans php - Hide constant variable when debugging

问题描述:

I have no idea why but for some days when i debbug with netbeans it shows every constant like if it was a variable in the "Variable" windows (i do php).

Example :

I define a constant :

And we can see it on the "Variable" tab :

As i have hundreds of defined constant, is there a solution to hide them ? Am i crazy or netbeans was not showing them before ? Maybe there is something to do with xdebug ?

If it can helps you, my netbeans version is the 8.0.2 (Build 201411181905).

网友答案:

This is actually new feature from version Xdebug 2.3.0.

They can be separated from regular variables but it hasn't been implemented in NetBeans yet (Current latest version Neteans 8.1). So until the feature is included in NetBeans you could use previous versions of Xdebug, for example 2.2.7 (You can get it from https://xdebug.org/download.php). But it does not support php 7.0 and up, so make sure you are running supported php version.

For installing different Xdebug check out: https://netbeans.org/kb/docs/php/configure-php-environment-windows.html#installXDebug

网友答案:

I've been using Netbeans with xdebug for quite long time. The only way so far I know that you can do it is: uncheck filter by "scalar types" (you'll see it when you right click at the "variables" and click "filter" in debug zone. But it'll will hide other variables as well, only array & super global stay if you checked it in the filter list.(quite helpful if you want to quick look at array).

If you don't want to hide all scalar types, you can work around like this:

  1. Sort by name: you will see all variable with the dollar sign at the top.
  2. Add to watches (but watches in netbeans is quite not stable)

That's all I know!

分享给朋友:
您可能感兴趣的文章:
随机阅读: