Re: Re: [RFC] Magic Method that handles unset($object)
| From: | Sebastian Bergmann | Date: | Sun, 10 Dec 2006 16:26:09 +0000 |
| Subject: | Re: Re: [RFC] Magic Method that handles unset($object) | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-26888@lists.php.net to get a copy of this message | ||
Sara Golemon wrote:
> To do this >right< you'd need notification, not just that unset() was
> called on the object, but what the current state of *both* of its
> relevant reference counts are.
I fail to see why. If we introduce a method that is called for
unset() then there should be no problem with resetting the
$children attribute to array() in my example:
unset($parent) -> "magic method" -> $children = array() -> no
references to $child objects
Nothing would happen in the case that you describe where other
references to the $child objects exist, of course.
--
Sebastian Bergmann http://sebastian-bergmann.de/
GnuPG Key: 0xB85B5D69 / 27A7 2B14 09E4 98CD 6277 0E5B 6867 C514 B85B 5D69