Re: New destructors implementation
| From: | Stephane Drouard | Date: | Mon, 09 Feb 2004 16:44:47 +0000 |
| Subject: | Re: New destructors implementation | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-7670@lists.php.net to get a copy of this message | ||
== Quote from Stephane Drouard (stephane.drouard@st.com)'s article
> == Quote from Andi Gutmans (andi@zend.com)'s article
> > He doesn't necessarily own a reference but tries to access it in the
> > destructor.
>
> IMO, this is bad programming. If an object wants to access another object (global or not), it
> has to own a reference on it, to guaranty the referenced object will be destroyed afterwards (so
> including destructor).
Couldn't PHP destroy global objects by taking their refcount into account? All objects with
refcount=1 are first destroyed, then all objects with refcount=2, and so on... Objects with a same
refcount are destroyed in a random "order".
Stephane