Re: interesting behavior of ob_end_flush() in __destruct()
| From: | aRZed | Date: | Sat, 25 Sep 2004 15:31:33 +0000 |
| Subject: | Re: interesting behavior of ob_end_flush() in __destruct() | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-197821@lists.php.net to get a copy of this message | ||
Chris Dowell wrote:
I haven't searched through the archives to refresh my memory, but it's something to bear in mind. I wonder whether error messages are also not passed to the browser.I have pointed out some more aspects of this issue: Error messages and normal output are passed to the browser as expected. (my first examlpe and the following) <?php class foo { public function __construct() { ob_start(); } public function __destruct() { echo "Destructor"; } } $f = new foo(); // outputs "Destructor" ?> still unclear is what happens when ob_start() is called in the destructor. but it seems that this has no serious effect. <?php class foo { public function __construct() { ob_start(); } public function __destruct() { ob_start(); echo "Destructor"; } } $f = new foo(); // no output - output is buffered ?> it seems that the destructor is called when output buffering is still deactivated but the connection to the client is active. i consider it a bit strange that output buffering is deactivated when there is still the possibility of passing something to the browser. greets aRZed