[prev in list] [next in list] [prev in thread] [next in thread] 

List:       php-general
Subject:    Re: [PHP] destructor sequence explained
From:       "Satyam" <Satyam () satyam ! com ! ar>
Date:       2007-02-28 11:08:01
Message-ID: 036201c75b28$bbffc730$03001aac () compaq
[Download RAW message or body]


----- Original Message ----- 
From: "Richard Lynch" <ceo@l-i-e.com>
To: "james james" <php.james@gmail.com>
Cc: <php-general@lists.php.net>
Sent: Wednesday, February 28, 2007 1:33 AM
Subject: Re: [PHP] destructor sequence explained


> On Tue, February 27, 2007 6:11 pm, james james wrote:
>> Can someone please help explain how the order of object destructors
>> called
>> at shutdown is determined, especially with regards to objects composed
>> of other objects?
>
> I think that changed from version to version, so unless you are on a
> dedicated server, you have to manage any order dependencies for
> yourself...
>
> I do not think there *IS* a documented ordering to this.
>

Actually, I think it is documented that the order of the destructors cannot 
be predicted. This means that even if you find how it is done in this 
particular version, don't count on that to hold if in a newer version they 
change it.  By stating that it cannot be predicted, the developers reserve 
the right to change it at any time.

When an object is deleted, it is put in the list of things to be dispossed 
of, and the garbage collector will call the destructors prior to 
deallocating the memory.  It can happen at any time when there is no higher 
priority stuff to be done.  So, it all depends on the whim of the garbage 
collector, a background item that the developers might change at any time 
and whose behaviour depends on lots of unpredictable things such as server 
load.

> You get whatever order PHP feels like using.

exactly

Satyam

>
> -- 
> Some people have a "gift" link here.
> Know what I want?
> I want you to buy a CD from some starving artist.
> http://cdbaby.com/browse/from/lynch
> Yeah, I get a buck. So?
>
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
> -- 
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.5.446 / Virus Database: 268.18.4/703 - Release Date: 26/02/2007 
> 14:56
>
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic