Re: Output in destructor

From: Date: Wed, 02 Jan 2002 23:46:52 +0000
Subject: Re: Output in destructor
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-3753@lists.php.net to get a copy of this message
Martin Jansen wrote: > > Hi, > > from the manual: > > "Note: PEAR "destructors" use PHP's shutdown callbacks > (register_shutdown_function()), and you can't output anything from these when > PHP is running in a web server. So anything printed in a "destructor" gets lost > except when PHP is used in command-line mode. Bummer." > > I think this is not right anymore, since the following script outputs > 'destructor' in PHP 4.2.0-dev as Apache module: > > <?php > require_once "PEAR.php"; > > class Test extends PEAR > { > function Test() > { > $this->PEAR(); > } > > function _Test() > { > echo "destructor"; > } > } > > $obj =& new Test; > ?> > > I can't test right now if this is also happening in 4.1.0. Can anyone > else with a running version of 4.1 do this? > > If it is also possible to generate output in 4.1, I will remove > the passage from the manual. Don't remove it, say that it doesn't work until version 4.1.0. :-) - Stig

« previous php.pear.dev (#3753) next »