View Issue Details

IDProjectCategoryView StatusLast Update
0000681XdebugUncategorizedpublic2011-09-19 21:17
Reportersergey.shymko Assigned Toderick  
PrioritynormalSeveritymajorReproducibilityalways
Status resolvedResolutionno change required 
Summary0000681: The recording of headers is broken in 2.1.1
Description

Xdebug 2.1.0beta1 introduced a feature of "the recording of headers being set in scripts".

Prior to Xdebug 2.1.1 it suppressed "headers already sent" PHP warning and recorded all headers even if output occur in scripts (at least in CLI mode).

Starting from Xdebug 2.1.1 it no longer prevents getting "headers already sent" PHP warning.

Actually, we were using this feature of Xdebug to be able to test headers with PHPUnit. And it was very helpful.

What are you going to decide to be an expected behavior?

Steps To Reproduce

prepare sample PHP script (test.php):

<?php

error_reporting(-1);

echo '!!!';

header('Content-Type: text/plain');

enable Xdebug 2.1.0 in php.ini

run sample script from the command line:

php -f test.php
!!!

enable Xdebug 2.1.1 in php.ini

run sample script from the command line:

php -f test.php
!!!PHP Warning: Cannot modify header information - headers already sent by (output started at test.php:3) in test.php on line 5
PHP Stack trace:
PHP 1. {main}() test.php:0
PHP 2. header() test.php:5

Warning: Cannot modify header information - headers already sent by (output started at test.php:3) in test.php on line 5

Call Stack:
0.0016 323272 1. {main}() test.php:0
0.0020 323384 2. header() test.php:5

TagsNo tags attached.
Operating System
PHP Version5.3.5

Activities

jweber

2011-08-23 00:28

reporter   ~0001793

I just noticed this change, after upgrading from 2.1.0 to 2.1.1.

A simple test is:
<?php echo " "; var_dump(headers_sent()); ?>

It prints " true" if xdebug is off, or xdebug 2.1.1 is on. And it prints " false" if xdebug 2.1.0 is on.

It would be nice to have an option to preserve this behavior in future versions of xdebug.

sergey.shymko

2011-08-29 20:26

reporter   ~0001795

Actually, if to investigate and think more deeply, the behavior of the latest xDebug versions seems to be correct, extension should not affect the language behavior. So, it's not a bug.

derick

2011-09-19 21:17

administrator   ~0001802

Indeed Sergey, it was broken in Xdebug 2.1.0 really.

Issue History

Date Modified Username Field Change
2011-04-15 00:52 sergey.shymko New Issue
2011-08-23 00:28 jweber Note Added: 0001793
2011-08-29 20:26 sergey.shymko Note Added: 0001795
2011-09-19 21:17 derick Note Added: 0001802
2011-09-19 21:17 derick Status new => resolved
2011-09-19 21:17 derick Resolution open => no change required
2011-09-19 21:17 derick Assigned To => derick
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