Re: Restore output buffer in case of exceptions

From: Date: Sun, 18 Nov 2007 02:23:28 +0000
Subject: Re: Restore output buffer in case of exceptions
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-33239@lists.php.net to get a copy of this message
That is the idea: <?php exceptional_ob_start(); echo "Begin\n"; try { echo "Exception\n"; throw new Exception(); } catch (Exception $e) {} echo "End\n"; exceptional_ob_end_flush();
You can do it, I think - just another bufferign inside try() and clean it on exception, then output it after try block ends. Buffers are stackable in PHP. -- Stanislav Malyshev, Zend Software Architect stas@zend.com http://www.zend.com/ (408)253-8829 MSN: stas@zend.com

« previous php.internals (#33239) next »