|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2011-08-22 14:22 UTC] kalle@php.net
[2011-08-22 14:24 UTC] kalle@php.net
-Status: Open
+Status: Assigned
-Assigned To:
+Assigned To: kalle
[2014-12-27 19:57 UTC] kalle@php.net
-Status: Assigned
+Status: Closed
[2014-12-27 19:57 UTC] kalle@php.net
[2014-12-27 20:00 UTC] kalle@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 15:00:01 2025 UTC |
Description: ------------ Output buffering inside output buffering handler is currently forbidden. Ideally, this limitation could be removed, but as this may be too much work, I mostly really miss some way to test whether my code is running inside an output buffering handler or not (for example in a custom error handler). PHP really miss a way to check for this situation. Currently, when using output buffering in an output buffering handler context, an E_ERROR is thrown. Could it be possible to trigger an E_RECOVERABLE_ERROR instead? This would allow me to catch the situation and degrade gracefully. Or maybe a new special function "ob_in_handler()", returning a boolean, is a better idea ? Test script: --------------- <?php ob_start('abc'); function abc() { ob_start(); } ?> Expected result: ---------------- PHP Catchable fatal error: ob_start(): Cannot use output buffering in output buffering display handlers in [...] on line 5 Actual result: -------------- PHP Fatal error: ob_start(): Cannot use output buffering in output buffering display handlers in [...] on line 5