|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
  [2003-12-02 18:56 UTC] michael at tapinternet dot com
 Description:
------------
ob_end_flush used to completely trim all output that had been collected, including whitespace at the end of previously included files.  That's not happening after an upgrade to PHP 4.3.4 (from 4.3.1).  
EXAMPLE:
test.php
<?
$foo='';
?>
     <--- note whitespace here
bar.php
<?
include('test.php');
ob_end_flush();
header("Content-type: application/ms-word");
echo "foobar";
?>
'foobar' will have a linebreak *before* it, even though the ob_end_flush() function has been called.
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits             | |||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Fri Oct 31 16:00:01 2025 UTC | 
I worded this wrong, I'm sorry, Dang - I made the whole thing wrong. It's not the 'flush' one it's ob_end_clean(). EXAMPLE: test.php <? $foo=''; ?> <--- note whitespace here bar.php <? include('test.php'); ob_end_clean(); header("Content-type: application/ms-word"); echo "foobar"; ?> ----------------- 'foobar' will have a linebreak *before* it, even though the ob_end_flush() function has been called. ----------------- Please reconsider the above issue. ob_end_clean() (this is what's in the code which was causing us problems after the upgrade) has changed behaviour. I've not made myself clear on this, and that's my fault. EVERYTHING has ob_start() at the top of the controller file, so the example files *only* have the ob_end_clean() in them when needed. This *should* be clearing out everything that's been collected in the output buffer up to that point. Previous versions apparently dealt with the whitespace in any include()d files as well, but this latest version (4.3.4) is breaking where earlier versions (4.3.1 and below) worked. If this behaviour has changed here, what else may have changed as well?