Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:26888 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 72116 invoked by uid 1010); 10 Dec 2006 16:27:53 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 72101 invoked from network); 10 Dec 2006 16:27:53 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 10 Dec 2006 16:27:53 -0000 Authentication-Results: pb1.pair.com header.from=news@sea.gmane.org; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=php-php-dev@m.gmane.org; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain m.gmane.org designates 80.91.229.2 as permitted sender) X-PHP-List-Original-Sender: php-php-dev@m.gmane.org X-Host-Fingerprint: 80.91.229.2 main.gmane.org Linux 2.5 (sometimes 2.4) (4) Received: from [80.91.229.2] ([80.91.229.2:35261] helo=ciao.gmane.org) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id EC/37-00543-3453C754 for ; Sun, 10 Dec 2006 11:27:18 -0500 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1GtRVU-0007e3-4f for internals@lists.php.net; Sun, 10 Dec 2006 17:26:28 +0100 Received: from 115.84-48-233.nextgentel.com ([84.48.233.115]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 10 Dec 2006 17:26:28 +0100 Received: from sb by 115.84-48-233.nextgentel.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 10 Dec 2006 17:26:28 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: internals@lists.php.net Date: Sun, 10 Dec 2006 17:26:09 +0100 Lines: 18 Message-ID: References: <457C330C.5050506@php.net> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: 115.84-48-233.nextgentel.com User-Agent: Thunderbird 2.0b1 (X11/20061210) In-Reply-To: <457C330C.5050506@php.net> X-Enigmail-Version: 0.94.1.0 Sender: news Subject: Re: [PHP-DEV] Re: [RFC] Magic Method that handles unset($object) From: sb@sebastian-bergmann.de (Sebastian Bergmann) 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