View Issue Details

IDProjectCategoryView StatusLast Update
0001368XdebugUncategorizedpublic2016-11-28 18:34
Reportersebastian Assigned Toderick  
Status resolvedResolutionnot fixable 
PlatformIrrelevantOSIrrelevantOS VersionIrrelevant
Product Version2.5.0RC1 
Summary0001368: xdebug_get_headers() does not include HTTP status headers

The result of xdebug_get_headers() does not contain information about HTTP status code headers sent through header():

header('HTTP/1.0 404 Not Found');

Executing the code shown above yields the output shown below:

array(0) {

xdebug_get_headers() works as expected for headers that are not not related to HTTP status codes

header('foo: bar');

Executing the code shown above yields the output shown below:

array(1) {
[0] =>
string(8) "foo: bar"

TagsNo tags attached.
Operating System
PHP Version7.1-dev



2016-11-28 18:34

administrator   ~0003805

I have done some research, and when in PHP you use a status code line like this, it bypasses the normal setting of headers. As it doesn't go through the normal SAPI function, I can't hook into it.

An alternative would be to overload the header() function and do it at that time. Because header() isn't the only function that sets headers (setcookie() and session handling do so too), this is going to get messy and potentially I am going to miss some. I therefore rather would not overload header().

Please reopen, if you have a better idea to solve this.

Issue History

Date Modified Username Field Change
2016-11-28 12:34 sebastian New Issue
2016-11-28 15:46 derick Assigned To => derick
2016-11-28 15:46 derick Status new => confirmed
2016-11-28 18:34 derick Note Added: 0003805
2016-11-28 18:34 derick Status confirmed => resolved
2016-11-28 18:34 derick Resolution open => not fixable
2020-03-12 16:35 derick Category Usage problems (Wrong Results) => Variable Display
2020-03-12 16:38 derick Category Variable Display => Uncategorized