Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:29821 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 61050 invoked by uid 1010); 27 May 2007 00:45:31 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 61035 invoked from network); 27 May 2007 00:45:31 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 27 May 2007 00:45:31 -0000 Received: from [127.0.0.1] ([127.0.0.1:29313]) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ECSTREAM id 2D/8B-49291-AA4D8564 for ; Sat, 26 May 2007 20:45:30 -0400 Authentication-Results: pb1.pair.com smtp.mail=m@digitalsandwich.com; spf=softfail; sender-id=softfail Authentication-Results: pb1.pair.com header.from=m@digitalsandwich.com; sender-id=softfail Received-SPF: softfail (pb1.pair.com: domain digitalsandwich.com does not designate 68.230.241.41 as permitted sender) X-PHP-List-Original-Sender: m@digitalsandwich.com X-Host-Fingerprint: 68.230.241.41 fed1rmmtao105.cox.net Solaris 10 (beta) Received: from [68.230.241.41] ([68.230.241.41:33941] helo=fed1rmmtao105.cox.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 24/7B-49291-CC0D8564 for ; Sat, 26 May 2007 20:29:03 -0400 Received: from fed1rmimpo02.cox.net ([70.169.32.72]) by fed1rmmtao105.cox.net (InterMail vM.7.05.02.00 201-2174-114-20060621) with ESMTP id <20070527002857.ITAG22040.fed1rmmtao105.cox.net@fed1rmimpo02.cox.net>; Sat, 26 May 2007 20:28:57 -0400 Received: from [127.0.0.1] ([68.229.46.230]) by fed1rmimpo02.cox.net with bizsmtp id 40Uw1X00X4xyrPo0000000; Sat, 26 May 2007 20:28:57 -0400 Message-ID: <4658D0CB.9070901@digitalsandwich.com> Date: Sat, 26 May 2007 17:28:59 -0700 User-Agent: Thunderbird 1.5.0.10 (Windows/20070221) MIME-Version: 1.0 To: Ken Stanley CC: internals@lists.php.net References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] late static binding From: m@digitalsandwich.com (Mike Lively) Ken Stanley wrote: > I've been researching the current status of late static binding, and I > came > across this mailing list with a few topics on this subject. After > doing the > reading, I had a couple of questions that maybe one of the experienced > parties involved could help clear up for me. Basically, I am wondering if > anybody has tossed around the idea of having a scope of child::, just > like > there is one of parent:: (for the class that is inherited from) and > self:: > (the current class). I understand that the idea has been discussed about > this:: or static::, but those two suggestions -- as fine as they are > -- just > seem counter intuitive. this has always been used in the same context as > self::, but for instantiated objects, and static:: seems redundant (at > least > to me). Is there a reason why this:: would be preferred over child::? It appears that all you are suggesting that is different from what has been discussed previously is purely syntactical. In that regard I would have to say that while neither this:: or static:: are jaw-droppers, child:: seems somewhar counter-intuitive to me. From a purely semantical standpoint, parent:: and self:: work because there is only ever one. On the other hand it seems like it would be somewhat confusing to a developer not aware of the syntax to figure out what child:: would mean. A class could have 'n' number of children and while I realize that it is not really what the late static binding is about it still seems awkward. > My second question on this topic would be how hard would it be to > create a > child scope in the Zend Engine? Since I am not a very experienced C > programmer, this may be a naive question, but if Zend is smart enough to > know who the inherited class object is, could it be much more > difficult to > know who did the inheriting? There is (with as much time as has passed this may be more accurately represented as was) a working patch to implement late static binding. I did some early work on it and it was then rewritten to store the required information in the proper places. If I recall correctly it was left at the point of someone needing to determine the performance impact of the patch and come up with solid use cases. > I know it has been said by some that this functionality is rare, but I > would > like to say that the functionality was just never needed until recently. > There are many cases that I can think of that this would be helpful, > and if > need be, I would be more than happy to write more examples. I think, > however, that the above example shows a good situation for the parent > class > to be able to see the child class. The term "late static binding" is slightly more rare than the functionality itself. There are a few other languages that implement similar concepts. I do know the ball was left firmly in my court on this issue last year and I also know that there has been continued interest from the php userbase about such a feature. If there is still support for it among the core developers I would be interested in taking up the issue again, reviewing and ensuring the most recent patch is still adequate as it relates to head, and determining the performance impact of the patch. -- Mike Lively http://www.digitalsandwich.com