Bug #51367 [Fbk->NoF]: flush() doesn't inform headers_sent()'s filename or linenumber values
| From: | php-bugs at lists dot php dot net | Date: | Mon, 18 Feb 2013 00:34:10 +0000 |
| Subject: | Bug #51367 [Fbk->NoF]: 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-176815@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=51367&edit=1
ID: 51367
Updated by: php-bugs@lists.php.net
Reported by: lefevre dot 10 at osu dot edu
Summary: flush() doesn't inform headers_sent()'s filename or
linenumber values
-Status: Feedback
+Status: No Feedback
Type: Bug
Package: Output Control
PHP Version: 5.2.13
New Comment:
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.
Previous Comments:
------------------------------------------------------------------------
[2012-04-16 08:56:51] jasper dot mattsson at gmail dot com
Still happens on
PHP 5.4.0-3~precise+4 (cli) (built: Mar 27 2012 08:50:50)
------------------------------------------------------------------------
[2012-02-15 13:44:10] zeusgerde at arcor dot de
Same bug for me on Windows 7 for PHP 5.3.10 (can't see a more recent version on
Windows snapshot site, only trunk with [0B])
Test script:
---------------
<?php
error_reporting(E_ALL);
ini_set('display_errors', 1);
header('Content-Type: text/plain');
flush();
echo phpversion(), "\n";
$file = 'a';
$line = 'b';
if (headers_sent($file, $line)) {
var_dump($file, $line);
}
header('X-Foo: Bar');
Expected result:
----------------
5.3.10
string(35) "D:\htdocs\test\php\headers_sent.php"
int(6) // or 7 for line 7 "flush();"
Warning: Cannot modify header information - headers already sent in
D:\htdocs\test\php\headers_sent.php on line 17
Actual result:
--------------
5.3.10
string(0) ""
int(0)
Warning: Cannot modify header information - headers already sent in
D:\htdocs\test\php\headers_sent.php on line 17
------------------------------------------------------------------------
[2010-05-19 14:41:57] mike@php.net
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.
------------------------------------------------------------------------
[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 https://bugs.php.net/bug.php?id=51367&edit=1