AW: [PHP-DEV] [RFC] Magic Method that handles unset($object)
| From: | Matthias Pigulla | Date: | Mon, 11 Dec 2006 08:45:27 +0000 |
| Subject: | AW: [PHP-DEV] [RFC] Magic Method that handles unset($object) | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-26898@lists.php.net to get a copy of this message | ||
> -----Ursprüngliche Nachricht-----
> Von: Etienne Kneuss [mailto:colder@php.net]
> Gesendet: Sonntag, 10. Dezember 2006 15:55
> Cc: internals@lists.php.net
> Betreff: Re: [PHP-DEV] [RFC] Magic Method that handles unset($object)
> You could use references, you would have to move some code
> around, though.
> I'm not sure that's exactly what you want, but give it a shot:
...
> $parent = &setup();
> $parent = null;
This happens to work in this case because when you assign null to $parent you break the reference
circle in the parent/child-relationship "by the way" because you work with references.
It's not a general solution, though.
mp.