#41773 [Fbk->Opn]: php_strip_whitespace sends headers with errors suppressed

From: Date: Sun, 24 Jun 2007 16:50:02 +0000
Subject: #41773 [Fbk->Opn]: php_strip_whitespace sends headers with errors suppressed
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-114127@lists.php.net to get a copy of this message
ID: 41773 User updated by: andi at splitbrain dot org Reported By: andi at splitbrain dot org -Status: Feedback +Status: Open Bug Type: Output Control Operating System: Linux (Debian unstable) PHP Version: 5.2.4-dev (200706222030) New Comment: Error suppression should suppress all output including sending headers. This is crucial when cookies need to be sent later in the code. Please note that this behavior broke in 5.2.3 and was working fine before (breaking existing code). Previous Comments: ------------------------------------------------------------------------ [2007-06-24 16:30:59] sniper@php.net And why shouldn't the headers be sent? You're not getting any fatal error there.. ------------------------------------------------------------------------ [2007-06-22 22:29:10] andi at splitbrain dot org Its still the same with the snapshot you linked. ------------------------------------------------------------------------ [2007-06-21 22:30:56] johannes@php.net Please try using this CVS snapshot: http://snaps.php.net/php5.2-latest.tar.gz For Windows (zip): http://snaps.php.net/win32/php5.2-win32-latest.zip For Windows (installer): http://snaps.php.net/win32/php5.2-win32-installer-latest.msi ------------------------------------------------------------------------ [2007-06-21 22:16:48] andi at splitbrain dot org Description: ------------ When suppressing error output of php_strip_whitespace and trying to load a non existent file, output is started. The code below prints "not sent" on older PHP versions but prints "sent" on PHP 5.2.3-1 Reproduce code: --------------- <?php $foo = @php_strip_whitespace('non existent file'); if(headers_sent()){ echo "sent\n"; }else{ echo "not sent\n"; } Expected result: ---------------- not sent Actual result: -------------- sent ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=41773&edit=1

« previous php.bugs (#114127) next »