Re: interesting behavior of ob_end_flush() in __destruct()

From: Date: Fri, 24 Sep 2004 21:19:28 +0000
Subject: Re: interesting behavior of ob_end_flush() in __destruct()
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-197801@lists.php.net to get a copy of this message
it seems that php first ends output buffering and then calls then destructs the objects. so the output buffering is still ended when the destructor is calles. one has to unset the object to reverse that order manually. aRZed If I remember correctly, there were a number of posts about this subject on the internals list before PHP5 came out. I seem to recall that the gist of it was that destructors are called *after* the script terminates. Someone mentioned that output from destructors (echo, print, etc) may not be passed to the browser at all due to the connection having (possibly) been closed.
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... Cheers Chris

« previous php.general (#197801) next »