Re: destructor sequence explained

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




----- Original Message ----- From: "Richard Lynch" <ceo@xxxxxxxxx>
To: "james james" <php.james@xxxxxxxxx>
Cc: <php-general@xxxxxxxxxxxxx>
Sent: Wednesday, February 28, 2007 1:33 AM
Subject: Re:  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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux