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

php.internals

Matthias Pigulla

19 years ago
> -----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.