note 14399 added to class.pear.php

From: Date: Mon, 30 Jul 2001 06:19:16 +0000
Subject: note 14399 added to class.pear.php
Groups: php.notes 
Request: Send a blank email to php-notes+get-16043@lists.php.net to get a copy of this message
One thing not mentioned in the manual (but noted in the source code of PEAR) is that in order for the destructor to work correctly in a subclass, you need to make sure you call $this->PEAR() in the constructor of your subclass. This is so that the function called by register_shutdown_function() calls the destructor you created. It is also recommended that your destructor call $this->_PEAR(). Note that since the function doesn't actually do anything right now it isn't recommended. However this will probably patch a "bug" in PEAR in the future. Namely, if you call the destructor manually, right now, PEAR doesn't remove the destructor callback from its list (for those who care, it is the global $_PEAR_destructor_object_list), so it will get called again when the PHP application shuts down. Of course, since all this occurs after the output to the client has been closed, none of these errors will be output to the browser. :-) -terry chay http://www.php.net/manual/en/class.pear.php

« previous php.notes (#16043) next »