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 something like $oSession->db = $oDB; should work in my opinion.
> Didn't test it and I have no real experience with destructors.

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.

Before asking for changes to this behavior, please check the mailing
list archives for a long discussion on the topic. :)

-adam

-- 
[EMAIL PROTECTED]
author of o'reilly's php cookbook
avoid the holiday rush, buy your copy today!

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to