Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000681XdebugUsage problemspublic2011-04-15 01:522011-09-19 22:17
Reportersergey.shymko 
Assigned Toderick 
PrioritynormalSeveritymajorReproducibilityalways
StatusresolvedResolutionno change required 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0000681: The recording of headers is broken in 2.1.1
DescriptionXdebug 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
Attached Files

- Relationships

-  Notes
(0001793)
jweber (reporter)
2011-08-23 01:28

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.
(0001795)
sergey.shymko (reporter)
2011-08-29 21:26

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.
(0001802)
derick (administrator)
2011-09-19 22:17

Indeed Sergey, it was broken in Xdebug 2.1.0 really.

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


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker