Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:21139 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 7302 invoked by uid 1010); 9 Dec 2005 14:10:15 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 7286 invoked from network); 9 Dec 2005 14:10:15 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 9 Dec 2005 14:10:15 -0000 X-Host-Fingerprint: 64.233.184.206 wproxy.gmail.com Linux 2.4/2.6 Received: from ([64.233.184.206:55142] helo=wproxy.gmail.com) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id 1D/88-48939-74099934 for ; Fri, 09 Dec 2005 09:10:15 -0500 Received: by wproxy.gmail.com with SMTP id i21so746195wra for ; Fri, 09 Dec 2005 06:09:38 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=kF2mi3lQN45zGPQDru4mBdnUX9cxuvujTMyEk2Ut3KE2yJiLddcLbMA/O42T7QJ45i4+VsIXm/fhLNY2HjcixSecLJHOgGhVo4Sl02rcnzvJWqpjuU2cKusvpIGk0T/MVnUADPA+7VBOigdRaj6tsdYvNVmf60cmKfIzEgNH2So= Received: by 10.54.142.10 with SMTP id p10mr4780629wrd; Fri, 09 Dec 2005 06:09:36 -0800 (PST) Received: by 10.54.77.20 with HTTP; Fri, 9 Dec 2005 06:09:36 -0800 (PST) Message-ID: <4e89b4260512090609k4eeaca4dyb763648b93c41e4@mail.gmail.com> Date: Fri, 9 Dec 2005 09:09:36 -0500 To: Alan Pinstein Cc: internals@lists.php.net In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <43970D54.1040206@zend.com> <63053C31-56D1-49A3-8D24-4FC41188A92A@mac.com> <7.0.0.16.2.20051208210843.059ef560@zend.com> Subject: Re: [PHP-DEV] $this->this and avoiding circular references From: kingwez@gmail.com (Wez Furlong) On 12/9/05, Alan Pinstein wrote: > However, my question, which still remains unanswered, is that I've > found a way that "seems" to create a weak reference and I'm simply > asking if what I am doing is condoned or just lucky (and thus a bad > idea that will probably break in the future)... The general rule of thumb is that if what you're doing makes you feel dirty inside, or feels wrong, or that it might not work in the future, then you shouldn't rely on it working that way. I'm not saying that this hack is or is not planned to go away, but there is a real possibility that it might go away as the side-effect of some othe= r change. So, if it works for you, that's fine... but if you're writing something tha= t you want to be used successfully with future PHP versions, then you should avoi= d using it. > And, if it's just lucky, then what is the solution to the problem? Am > I just SOL? Is the answer simply that if you *need* to create > circular references in PHP, then you *must* accept memory leakage? While I love the idea of writing everything in PHP, if you find yourself up against a limitation that you can't avoid without nasty hacks, then perhaps PHP is the wrong tool for that particular job. --Wez.