Removal of default _PEAR() destructor
| From: | Patrick O'Lone | Date: | Tue, 22 Apr 2003 17:28:06 +0000 |
| Subject: | Removal of default _PEAR() destructor | ||
| Groups: | php.pear.dev | ||
| Request: | Send a blank email to pear-dev+get-15340@lists.php.net to get a copy of this message | ||
I've noticed a problem when a large number of objects are instantiated.
A reference to the object is maintained by PEAR's object destructor list
even if a destructor is not defined for any of the objects except for
the default PEAR class. This forces PEAR to maintain a reference to an
object that otherwise has no need for a destructor and can be unset() at
runtime to conserve memory. Since the method is merely for debug
purposes, I don't think this method should exist.
/**
* Destructor (the emulated type of...). Does nothing right now,
* but is included for forward compatibility, so subclass
* destructors should always call it.
*
* See the note in the class desciption about output from
* destructors.
*
* @access public
* @return void
*/
function _PEAR() {
if ($this->_debug) {
printf("PEAR destructor called, class=%s\n",
get_class($this));
}
}
At the very least, there should be an option for disabling the default
destructor of the PEAR class.
If you have questions, comments, or suggestions about the aforementioned
message, you can respond by replying to this message or contacting us at
(309)-743-0800. Thank you.
Regards,
Patrick O'Lone
Internet Software Engineer
TownNews.com
(309)-743-0809
polone@townnews.com