On Nov 18, 2007 1:38 AM, Evert | Rooftop <[EMAIL PROTECTED]> wrote:
> Generally I make sure that the parts of my code that start an output
> buffer are also responsible for closing the output buffer.. so something
> like this wouldn't be uncommon in my code..
>
>
> ob_start();
> try {
> do_something();
> } catch (Exception $e) {
> ob_end_clean();
> throw $e;
> }
>
> $data = ob_get_clean();
>
Thanks for the answers. I wasn't aware of the fact that ob's could
nest. So one can manually translate the first try-catch to the second:
try {
// ... code
} catch (Exception $e) {
// ... code
}
ob_start();
try {
// ... code
ob_end_flush();
} catch (Exception $e) {
ob_end_clean();
// ... code
}
More verbose, but works.
--
Mehmet
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php