Bug #51367 [Opn->Fbk]: flush() doesn't inform headers_sent()'s filename or linenumber values

From: Date: Wed, 19 May 2010 12:41:58 +0000
Subject: Bug #51367 [Opn->Fbk]: flush() doesn't inform headers_sent()'s filename or linenumber values
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-150599@lists.php.net to get a copy of this message
Edit report at http://bugs.php.net/bug.php?id=51367&edit=1

 ID:          51367
 Updated by:  mike@php.net
 Reported by: lefevre dot 10 at osu dot edu
 Summary:     flush() doesn't inform headers_sent()'s filename or
              linenumber values
-Status:      Open
+Status:      Feedback
 Type:        Bug
 Package:     Output Control
 PHP Version: 5.2.13

 New Comment:

Please try using this snapshot:

  http://snaps.php.net/php5.3-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/

headers_sent() after flush() returns FALSE for me.


Previous Comments:
------------------------------------------------------------------------
[2010-03-23 18:46:36] lefevre dot 10 at osu dot edu

Change the '1 = 1' to '$a = 1' in test script ;)

------------------------------------------------------------------------
[2010-03-23 18:43:25] lefevre dot 10 at osu dot edu

Description:
------------
If flush() is called, a subsequent call to headers_sent() with $filename
and $linenumber specified does not bind the actual file name and line
number of the line where flush() appeared. Instead the values are empty
string and 0, respectively.

Test script:
---------------
<?

1 = 1;

flush();

if ( headers_sent( $file, $line) ) {
    echo "Headers sent at $file: $line<br>";
}

echo "Some text here.<br>";

if ( headers_sent( $file, $line) ) {
    echo "Headers sent at $file: $line<br>";
}


Expected result:
----------------
Headers sent at '/var/www/flush_test.php', line 5.
Some text here.
Headers sent at '/var/www/flush_test.php', line 8.

Actual result:
--------------
Headers sent at '', line 0.
Some text here.
Headers sent at '/var/www/flush_test.php', line 8.


------------------------------------------------------------------------



-- 
Edit this bug report at http://bugs.php.net/bug.php?id=51367&edit=1


Thread (6 messages)

« previous php.bugs (#150599) next »