|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-09-29 15:35 UTC] mgf@php.net
[2004-09-29 21:30 UTC] mpn at illearth dot net
[2004-09-29 21:57 UTC] mpn at illearth dot net
[2004-09-30 03:32 UTC] iliaa@php.net
[2004-09-30 06:34 UTC] mpn at illearth dot net
[2004-09-30 16:11 UTC] mpn at illearth dot net
[2004-09-30 22:45 UTC] iliaa@php.net
[2004-10-01 05:12 UTC] mpn at illearth dot net
[2004-10-01 05:12 UTC] mpn at illearth dot net
[2004-11-28 14:34 UTC] tony2001@php.net
[2004-12-06 01:00 UTC] php-bugs at lists dot php dot net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Nov 03 04:00:01 2025 UTC |
Description: ------------ When checking the value of headers_sent(), function is returning FALSE even though headers have clearly been sent. Returned result does not change when output buffering is commented out or where output buffering is started (i.e before sending headers or after ). I crammed the test code into 19 lines, so please excuse the formatting. ["SERVER_SOFTWARE"]=> string(31) "Apache/2.0.49 (Win32) PHP/4.3.9" using sapi Reproduce code: --------------- <?php ob_clean(); if ( stristr( $_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip' ) ) { ob_start( 'compressOutput' ); } else { ob_start(); } header( 'Expires: Mon, 26 Jul 1997 05:00:00 GMT' ); header( 'Cache-Control: no-store, no-cache, must-revalidate' ); header( 'Cache-Control: post-check=0, pre-check=0', FALSE ); header( 'Last-Modified: ' . gmdate( 'D, d M Y H:i:s' ) . ' GMT' ); header( 'Pragma: no-cache' ); echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">' . "\n\n"; echo '<html><head>' . "\n";echo '<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />' . "\n";echo '<meta http-equiv="content-language" content="en-GB" />' . "\n"; echo '</head><body>headers_sent() Returned Value Is: ' . "\n"; var_dump( headers_sent() ); echo '</body></html>' . "\n"; ob_end_flush(); function compressOutput( $str ) { $_output = gzencode( $str ); if ( (bool)FALSE === $_output ) { return $str; } header( 'Content-Encoding: gzip' ); return $_output; } // End Function compressOutput ?> Expected result: ---------------- var_dump( headers_sent() ); = (bool)true Actual result: -------------- var_dump( headers_sent() ); = (bool)false