Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:12041 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 34079 invoked by uid 1010); 9 Aug 2004 18:28:30 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 34032 invoked from network); 9 Aug 2004 18:28:29 -0000 Received: from unknown (HELO jan.prima.de) (83.97.50.139) by pb1.pair.com with SMTP; 9 Aug 2004 18:28:29 -0000 Received: from BAUMBART (p508EAF4A.dip.t-dialin.net [::ffff:80.142.175.74]) (IDENT: HydraIRC, AUTH: LOGIN tobi) by jan.prima.de with esmtp; Mon, 09 Aug 2004 18:25:44 +0000 Date: Mon, 9 Aug 2004 20:28:12 +0200 Reply-To: Marcus Boerger X-Priority: 3 (Normal) Message-ID: <112941408.20040809202812@marcus-boerger.de> To: Curt Zirzow CC: internals@lists.php.net In-Reply-To: <20040809174607.GK6522@bagend.shire> References: <20040808022353.GG6522@bagend.shire> <20040808111514.43930.qmail@pb1.pair.com> <20040809174607.GK6522@bagend.shire> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Re: objects passed as reference in php5 From: helly@php.net (Marcus Boerger) Hello Curt, Monday, August 9, 2004, 7:46:07 PM, you wrote: > * Thus wrote Ron Korving: >> i think the object will only cease to exist when all references to it are >> gone > Well there does seem to be another layer of referencing, since the > a simple assignment without &$ will simply reference the object but > in a different way. The problem I'm running into there doesn't > seem to be a way to reliably detstroy an object without the > programmer keeping track of the variable assignments and removing > those references as well. > I'm not sure if its possible or even php's responsibility but > perhaps provide a tool that allow's a programmer to explicity > destroy an object? with something like: > Destroy($obj); This is not possible at all. Reference counting + garbage collection means we do know the exact number of references to an object. Destroying the referenced object before its reference count goes to zero means that we leave a reference pointing to nirvana. That would result in a SEGV. regards marcus