From: scottmacvicar at ntlworld dot com
Operating system: Windows XP SP1
PHP version: 4CVS-2003-09-30 (stable)
PHP Bug Type: Apache2 related
Bug description: Calling flush from within an output buffer prevents headers from being sent

Calling flush in Apache and Apache 2 produce different results.

Within Apache after calling flush you can still send headers as the output
buffer prevents it from actually being flushed.

Within Apache 2 after calling flush you can no longer send headers even
though headers_sent still returns false.

Reproduce code:


echo 'test';

$newtext = ob_get_clean();

if (strpos(' ' . $_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip') !== false AND
header('Content-Encoding: gzip');
$newtext = gzencode($newtext, 1);

header('Content-Length: ' . strlen($newtext));
echo $newtext;


Expected result:

Actual result:
binary data

Edit bug report at [url][/url]
Try a CVS snapshot (php4): [url][/url]
Try a CVS snapshot (php5): [url][/url]
Fixed in CVS: [url][/url]
Fixed in release: [url][/url]
Need backtrace: [url][/url]
Try newer version: [url][/url]
Not developer issue: [url][/url]
Expected behavior: [url][/url]
Not enough info: [url][/url]
Submitted twice: [url][/url]
register_globals: [url][/url]
PHP 3 support discontinued: [url][/url]
Daylight Savings: [url][/url]
IIS Stability: [url][/url]
Install GNU Sed: [url][/url]
Floating point limitations: [url][/url]