Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:7599 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 60661 invoked by uid 1010); 4 Feb 2004 23:58:53 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 60637 invoked from network); 4 Feb 2004 23:58:52 -0000 Received: from unknown (HELO shiva.mind.de) (212.42.230.204) by pb1.pair.com with SMTP; 4 Feb 2004 23:58:52 -0000 Received: from [192.168.1.100] (p508E9913.dip.t-dialin.net [80.142.153.19]) by shiva.mind.de (Postfix) with ESMTP id 1111C97B66; Thu, 5 Feb 2004 00:58:45 +0100 (CET) Date: Thu, 5 Feb 2004 01:00:05 +0100 Reply-To: Marcus Boerger X-Priority: 3 (Normal) Message-ID: <153-442460609.20040205010005@marcus-boerger.de> To: Zeev Suraski Cc: Andrei Zmievski , internals@lists.php.net In-Reply-To: <5.1.0.14.2.20040205012223.07b18ff8@localhost> References: <5.1.0.14.2.20040204115844.04341008@localhost> <5.1.0.14.2.20040204115844.04341008@localhost> <5.1.0.14.2.20040205012223.07b18ff8@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] New destructors implementation From: helly@php.net (Marcus Boerger) Hello Zeev, Thursday, February 5, 2004, 12:24:47 AM, you wrote: > At 23:45 04/02/2004, Andrei Zmievski wrote: >>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. > If it's a PHP-style object, then you can use zend_objects_destroy_object as > your destructor callback (when calling zend_objects_store_put()), in which > case __destruct() will be called. That's how the regular PHP objects do it. So my guess is that for most internal objects we need to do so? -- Best regards, Marcus mailto:helly@php.net