[PHP-DEV] Re: Destructors

2004-05-24 Thread Christian Schneider
Jason Garber wrote: Based on the above example, the $oSession-__destruct() method relies on the $oDB object still being usable. How can this be structured to ensure that the DB object does not get released first? Adding something like $oSession-db = $oDB; should work in my opinion. Didn't test

Re: [PHP-DEV] Re: Destructors

2004-05-24 Thread Adam Maccabee Trachtenberg
On Mon, 24 May 2004, Christian Schneider wrote: Jason Garber wrote: Based on the above example, the $oSession-__destruct() method relies on the $oDB object still being usable. How can this be structured to ensure that the DB object does not get released first? It can't. Adding

Re: [PHP-DEV] Re: Destructors

2004-05-24 Thread Christian Schneider
Adam Maccabee Trachtenberg wrote: That's not guaranteed to work. PHP 5 does not guarantee that object destructors will be called in any particular order or that the order will remain constant from one invocation to another. Ok, I was under the impression that PHP won't call any destructors of

Re: [PHP-DEV] Re: Destructors

2004-05-24 Thread Lukas Smith
Christian Schneider wrote: Adam Maccabee Trachtenberg wrote: That's not guaranteed to work. PHP 5 does not guarantee that object destructors will be called in any particular order or that the order will remain constant from one invocation to another. Ok, I was under the impression that PHP won't

Re: [PHP-DEV] Re: Destructors

2004-05-24 Thread Adam Maccabee Trachtenberg
On Mon, 24 May 2004, Lukas Smith wrote: unless you manually unset the objects in the order in which you want them to be destructed. Right. That'll also work. :) -adam -- [EMAIL PROTECTED] author of o'reilly's php cookbook avoid the holiday rush, buy your copy today! -- PHP Internals - PHP

Re: [PHP-DEV] Re: Destructors

2004-05-24 Thread John Coggeshall
On Mon, 2004-05-24 at 10:40, Adam Maccabee Trachtenberg wrote: Right. That'll also work. :) I suppose you could push object references on a stack and register a shutdown function which pops / unset()s if you really wanted a order to it.. (that's an untested theory though) John --

Re: [PHP-DEV] Re: Destructors

2004-05-24 Thread Lukas Smith
John Coggeshall wrote: On Mon, 2004-05-24 at 10:40, Adam Maccabee Trachtenberg wrote: Right. That'll also work. :) I suppose you could push object references on a stack and register a shutdown function which pops / unset()s if you really wanted a order to it.. (that's an untested theory though)