View Issue Details

IDProjectCategoryView StatusLast Update
0000625XdebugUncategorizedpublic2012-12-18 12:36
Reporterjpic Assigned Toderick  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Target Version2.2.2Fixed in Version2.2.2 
Summary0000625: xdebug_get_headers() -> Headers are reset unexpectedly.
Description

Headers are emptied unexpectedly according to xdebug_get_headers().

Steps To Reproduce

~ cat test_xdebug.php
<?php
header( 'Location: bar');
var_dump( xdebug_get_headers( ) );
header( 'HTTP/1.0 404 Not Found' );
var_dump( xdebug_get_headers( ) );

Expected result:

array(1) {
[0]=>
string(13) "Location: bar"
}
array(0) {
[0]=>
string(13) "Location: bar"
[1]=>
string(22) "HTTP/1.0 404 Not Found"
}

Actual result:

array(1) {
[0]=>
string(13) "Location: bar"
}
array(0) {
}

TagsNo tags attached.
Operating System
PHP Version5.2.8

Activities

whatthejeff

2010-12-03 03:59

reporter   ~0001618

A suggested patch:

Index: xdebug.c

--- xdebug.c (revision 3374)
+++ xdebug.c (working copy)
@@ -1683,7 +1683,6 @@
string = XDEBUG_LLIST_VALP(le);
add_next_index_string(return_value, string, 1);
}

  • xdebug_llist_empty(XG(headers), NULL);
    }

Index: tests/bug00625.phpt

--- tests/bug00625.phpt (revision 0)
+++ tests/bug00625.phpt (revision 0)
@@ -0,0 +1,17 @@
+--TEST--
+Test for bug 0000625: xdebug_get_headers() -> Headers are reset unexpectedly.
+--FILE--
+<?php
+header('Foo:Bar');
+var_dump(xdebug_get_headers());
+var_dump(xdebug_get_headers());
+?>
+--EXPECTF--
+array(1) {

  • [0]=>
  • string(7) "Foo:Bar"
    +}
    +array(1) {
  • [0]=>
  • string(7) "Foo:Bar"
    +}

jpic

2011-06-06 17:08

reporter   ~0001752

According to your patch, it looks more like a feature than a bug doesn't it ?

derick

2012-12-17 20:03

administrator   ~0002392

Fixed for Xdebug 2.2.2.

Issue History

Date Modified Username Field Change
2010-10-07 14:00 jpic New Issue
2010-12-03 03:59 whatthejeff Note Added: 0001618
2011-06-06 17:08 jpic Note Added: 0001752
2012-03-12 16:44 derick Target Version => 2.2.1
2012-07-14 22:14 derick Target Version 2.2.1 => 2.2.2
2012-12-17 20:03 derick Note Added: 0002392
2012-12-17 20:03 derick Status new => closed
2012-12-17 20:03 derick Assigned To => derick
2012-12-17 20:03 derick Resolution open => fixed
2012-12-18 12:36 derick Fixed in Version => 2.2.2
2016-07-31 12:36 derick Category Usage problems => Usage problems (Crashes)
2016-07-31 12:38 derick Category Usage problems (Crashes) => Usage problems (Wrong Results)
2020-03-12 16:35 derick Category Usage problems (Wrong Results) => Variable Display
2020-03-12 16:38 derick Category Variable Display => Uncategorized