This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 230764 - PHP debugger changes strings greater than 1024 to null
Summary: PHP debugger changes strings greater than 1024 to null
Alias: None
Product: php
Classification: Unclassified
Component: Debugger (show other bugs)
Version: 7.3
Hardware: All All
: P3 normal (vote)
Assignee: Ondrej Brejla
Depends on: 230850
  Show dependency tree
Reported: 2013-06-05 08:09 UTC by doliver3
Modified: 2019-01-31 18:20 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Note You need to log in before you can comment on or make changes to this bug.
Description doliver3 2013-06-05 08:09:24 UTC
Putting any String into the debugger that is greater than 1024 characters (whether variable or literal string) returns null.  Concatenating 2 string values that have a resulting length greater than 1024 returns null.  

To demonstrate the basic problem get into debug on a line of PHP with xdebug then add these 2 watches:

str_repeat('a',1024) // this works
str_repeat('a',1025) // this returns the value null (null shows up as the value)

That is for demonstration, but the this is really a huge problem because Netbeans actually changes the values of the variables you are watching and concatenating as well.  Also if one variable is changed to null by Netbeans then concatenating that value with another valid String will return a null. 

1. The debugger should not be altering the underlying values arbitrarily. 

If Netbeans is just trying to protect itself from too much memory usage, the appropriate IDE behavior should be truncation with a note to let the developer know that it is trunctated. This would be tremendously better than changing the string from a value to a null - changing the value is completely awful behavior because as a developer one doesn't know the source of this arbitrary null value. 

It took me hours to realize that it was actually Netbeans causing this awful behavior rather than any code or library or even xdebug.  Developers should be able to trust their IDE not to lie to them about values and IDEs should not alter executing code values arbitrarily without notification. 

2. Netbeans should offer a setting value to allow this arbitrary 1024 value to be increased to whatever the developer needs the setting to be.
Comment 1 Jiri Kovalsky 2013-06-05 08:14:06 UTC
This is not a problem of Java Debugger.
Comment 2 doliver3 2013-06-05 09:41:02 UTC
Good to know that it is not a problem with Java debugger if you've tested that.  Thanks. 

However, it is still a huge issue with the PHP debugger, and as far as I can tell it is not related to xdebug settings.  

In xdebug, I can bump up the size of variables it is handling by setting the value of xdebug.var_display_max_data to -1 or to some specific byte size like 2048.  However, Netbeans still ignores these settings and always sets any Strings larger than 1024 to be the value 'null'.  

The whole point of an IDE debugger is to allow the developer to see the values in the variables.  If the IDE cannot do that, the IDE's debugger is not much use.  1024 bytes is very arbitrarily low.  We often have JSON variables these days that may have many kilobytes of data in them. A PHP developer needs to be able to pull these values out using the IDE debugger.

My current xdebug settings are as follows...

xdebug.remote_cookie_expire_time = 36000
Comment 3 Ondrej Brejla 2013-06-05 09:51:27 UTC
I just tested that on Mac with the latest dev build and I see a bit different issue. 

$test = str_repeat('a',2048);
exit; // breakpoint here

If NB stops on BP, I see "Evaluating..." text in variable view. Which is strange, because if I move cursor over "$test" var, its content is shown properly and suddenly "Evaluating..." text disappears and the proper content is shown. I didn't see any "null" issue.

But I will evaluate it further. Thanks.
Comment 4 Ondrej Brejla 2013-06-05 11:10:51 UTC
I just made some evaluation...if I increase MAX_DATA directly in NB code, everything works...but if I try to set it via xdebug.var_display_max_data=2048, it's ignored. Understand...NB module doesn't get setted value, but just 2014. It seems that that directive is ignored in php.ini.

I will try to make some more evaluation...
Comment 5 Ondrej Brejla 2013-06-05 11:20:12 UTC
I have a suspicion that we both edit wrong php.ini :)
Comment 6 Ondrej Brejla 2013-06-05 11:29:24 UTC
No we edit the right PHP.ini ;) When I set a logging directory, communication is logged properly.

But...In log I see this line: 

<- feature_get -i 69 -n max_data
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="" command="feature_get" transaction_id="69" feature_name="max_data" supported="1"><![CDATA[1024]]></response>

Which is strange, because I have:

xdebug.var_display_max_data = 3000

So for me it seems that XDebug has an issue itself...that it still sends us wrong max_data value, even when we set it directly in php.ini...
Comment 7 Ondrej Brejla 2013-06-05 11:34:03 UTC
(In reply to comment #6)
> No we edit the right PHP.ini ;) 

Ehm...probably not exactly :) Logging works when I try to debug my script by "Run Configuration -> Script" if I change run configuration to  "Local Web Site", logging doesn't work.

But it still doesn't solve a problem, why xdebug.var_display_max_data = 3000 directive is ignored by XDebug even though the logging directive works...
Comment 8 Ondrej Brejla 2013-06-06 09:45:42 UTC
I just tested that on linux and it seems that the xdebug.var_display_max_data directive is ignored there too :( Everytime I get 1024. It doesn't metter what I set in php.ini, first returned value from XDebug itself is 1024.
Comment 9 Ondrej Brejla 2013-06-06 11:30:14 UTC
I found the cause of such a strange behavior...xdebug issue:

So it's a common behavior (since IDEs use remote debugging...).

Ok, so I'll add an input to Options -> PHP -> Debugging to set a custom value of Max Data.
Comment 10 Ondrej Brejla 2013-06-06 12:20:44 UTC
Debugger part is done in web-main #ca5fe3f4c6ed. Waiting for issue #230850 to complete it.
Comment 11 Ondrej Brejla 2013-06-07 08:14:11 UTC
Fixed in web-main #1926847fc601
Comment 12 Quality Engineering 2013-06-08 01:11:05 UTC
Integrated into 'main-golden', will be available in build *201306072301* on (upload may still be in progress)
User: Ondrej Brejla <>
Log: #230764 - PHP debugger changes strings greater than 1024 to null
Comment 13 Panda77 2019-01-31 15:49:56 UTC
same problem with netbeans 8.1

Putting any String into the debugger that is greater than 1024 characters returns null.

i have set xdebug.var_display_max_data=3000...

but nothing
Comment 14 Jiri Kovalsky 2019-01-31 18:19:18 UTC
Nobody is going to fix defects in NetBeans 8.1. If you can reproduce the issue in Apache NetBeans 10.0 then please report this defect to Apache Jira here:!default.jspa Thank you.
Comment 15 Jiri Kovalsky 2019-01-31 18:20:15 UTC