Mehmet Yavuz Selim Soyturk wrote:
Hello,

I'm sorry if that's the wrong list.

I am neither a PHP nor a webscripting guy so I'm sorry if this does
not make sense. I just thought that it could be useful.

PHP 5 supports exception handling. When an exception occurs, PHP does
stack unwinding so that it restores the state of the script. But an
important state of the script does not get restored: the output. Would
it not be a good idea if PHP also did some sort of output buffer
unwinding?
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();

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to