Re: New destructors implementation
| From: | Andrei Zmievski | Date: | Wed, 04 Feb 2004 21:45:17 +0000 |
| Subject: | Re: New destructors implementation | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-7585@lists.php.net to get a copy of this message | ||
On Wed, 04 Feb 2004, Andi Gutmans wrote:
> 3. The APIs have changed to allow for this new mechanism. Instead of the
> previous dtor callback, which was supposed to both call the destructor and
> free the object's storage, there are now two separate callbacks - dtor
> (call the destructor) and free_storage (guess). Generally, for classes
> which implement PHP-style objects, you should implement both of these
> callbacks (though you can probably use the standard dtor callback). For
> overloaded classes such as SimpleXML, COM, etc. - you will most likely only
> have to implement the free_storage callback, as there's no destructor
> per-se. We already went over all the overloaded classes in the php-src CVS
> and moved most of the dtor callbacks to free_storage. Note that the
> interface is slightly different between these two callbacks - free_storage
> doesn't receive the object handle.
Is there an automatic call to __destruct() method then? Because I'd like
my PHP-GTK objects to have that method called upon destruction and I
don't feel like reimplementing the mechanism for doing that.
- Andrei