|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-09-08 00:21 UTC] rasmus@php.net
[2004-09-08 16:01 UTC] php at terrarium dot f9 dot co dot uk
[2012-04-14 12:18 UTC] nikic@php.net
[2012-04-14 12:18 UTC] nikic@php.net
-Status: Open
+Status: Closed
-Package: Feature/Change Request
+Package: *General Issues
-Assigned To:
+Assigned To: nikic
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Dec 04 06:00:01 2025 UTC |
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