From: php at terrarium dot f9 dot co dot uk Operating system: Debian GNU/Linux Unstable PHP version: 4.3.8 PHP Bug Type: Output Control Bug description: output buffer closed before shutdown functions called
Description: ------------ When using output buffering if the output buffer is still open when the script terminates php automatically closes it and writes the contents to the browser. Unfortunately it does this before any functions which have been registered with register_shutdown_function are called, so these functions cannot manipulate or cancel the output. It also prevents shutdown_functions adding headers. Reproduce code: --------------- <?php ob_start(); register_shutdown_function( 'clear_buffer' ); function clear_buffer() { ob_end_clean(); } echo 'Foo'; ?> Expected result: ---------------- No output displayed as the output buffer is cleared at the end of the script Actual result: -------------- Foo is output -- Edit bug report at http://bugs.php.net/?id=30015&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=30015&r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=30015&r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=30015&r=trysnapshot51 Fixed in CVS: http://bugs.php.net/fix.php?id=30015&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=30015&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=30015&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=30015&r=needscript Try newer version: http://bugs.php.net/fix.php?id=30015&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=30015&r=support Expected behavior: http://bugs.php.net/fix.php?id=30015&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=30015&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=30015&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=30015&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=30015&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=30015&r=dst IIS Stability: http://bugs.php.net/fix.php?id=30015&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=30015&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=30015&r=float MySQL Configuration Error: http://bugs.php.net/fix.php?id=30015&r=mysqlcfg