Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:21149 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 66413 invoked by uid 1010); 9 Dec 2005 18:16:46 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 66398 invoked from network); 9 Dec 2005 18:16:46 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 9 Dec 2005 18:16:46 -0000 X-Host-Fingerprint: 17.250.248.87 smtpout.mac.com FreeBSD 4.8-5.1 (or MacOS X 10.2-10.3) Received: from ([17.250.248.87:49238] helo=smtpout.mac.com) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id 9E/4F-48939-E0AC9934 for ; Fri, 09 Dec 2005 13:16:46 -0500 Received: from mac.com (smtpin03-en2 [10.13.10.148]) by smtpout.mac.com (Xserve/8.12.11/smtpout05/MantshX 4.0) with ESMTP id jB9IG6GZ020220; Fri, 9 Dec 2005 10:16:07 -0800 (PST) Received: from [10.0.1.102] (c-24-98-128-251.hsd1.ga.comcast.net [24.98.128.251]) (authenticated bits=0) by mac.com (Xserve/smtpin03/MantshX 4.0) with ESMTP id jB9IG4u2022651 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NO); Fri, 9 Dec 2005 10:16:05 -0800 (PST) In-Reply-To: <4399C489.9040600@iamjochem.com> References: <43970D54.1040206@zend.com> <63053C31-56D1-49A3-8D24-4FC41188A92A@mac.com> <7.0.0.16.2.20051208210843.059ef560@zend.com> <4399B2D7.6020500@iamjochem.com> <7.0.0.16.2.20051209090744.05acc7f0@zend.com> <4399C489.9040600@iamjochem.com> Mime-Version: 1.0 (Apple Message framework v746.2) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-ID: <0DD6CFA8-1EB1-4A3D-BAC2-77FDDD2FB138@mac.com> Cc: Andi Gutmans , internals@lists.php.net Content-Transfer-Encoding: 7bit Date: Fri, 9 Dec 2005 13:16:02 -0500 To: Jochem Maas X-Mailer: Apple Mail (2.746.2) Subject: Re: [PHP-DEV] $this->this and avoiding circular references From: apinstein@mac.com (Alan Pinstein) > regarding the actually topic of this thread I'm very interested > in the concept of 'weak references' (as Apple seems to call them), > what '$this->this' is all about, and whether using reference notation > with object variable assignment is even allowed, whether it it makes > a difference and what the future holds with regard to being able to > use/create references to object 'handles'. Yes, back to the thread :) So a colleague on the propel-dev list has convinced me that my approach is bad, mostly because of how references behave in PHP. While doing my "research" I stumbled on to the fact that making references doesn't bump refcounts, and got so excited by the potential "solution" to my problem that I forgot about the flip-side of using references, which is that it binds the reference to the same place as the original. Thus, when the original changes, it changes the target of your "stored link". So my solution in the end won't work at all. However, the need is definitely still there. Andi briefly mentioned an alternative solution, and I am eagerly awaiting his complete response... c'mon with it Andi! Another poster recommended that maybe PHP isn't the right "tool" for the job [of importing data]. This would imply that PHP is for your web pages, but no other part of your application. Well, if I am starting out on a new project, I'd like for the entire project to be in one language. I want to be able to have all of my business logic for my application's model in one place, and be able to use this core model from the web, scripts, etc. This poster's comment would indicate that PHP's stated purpose is as a web tool only, and isn't intended as a project (now or in the future) to be a universal solution to building applications. If this is the case, I'd consider it a shame, and it would have me seriously reconsider using PHP long term. A mindset like this is why there is such anti-php sentiment from the ruby and python people. Whether you like it or not, PHP has become a complete language platform. I like the PHP paradigm overall, but need to be able to have projects entirely in PHP for it to be worthwhile to use. If I have to develop my core model in Java [or whatever], I am not sure that I would use PHP to do the front-end. Although, on a side note, I did recently use the excellent php-java- bridge to build a PHP front-end to a Java search engine, and it works very well. Not sure yet about performance, though. Alan