# AW:  [RFC] Magic Method that handles unset($object)

- Thread: https://externals.io/message/26898
- Original archive: https://news-web.php.net/php.internals/26898
- Started by Matthias Pigulla on 2006-12-11T08:45:27+00:00
- Messages: 1
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · RFCs at https://externals.io/rfc.md · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #26898 — Matthias Pigulla — 2006-12-11T08:45:27+00:00

URL: https://externals.io/message/26898#26898

> -----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.
