Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:33290 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 18642 invoked by uid 1010); 19 Nov 2007 07:10:28 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 18624 invoked from network); 19 Nov 2007 07:10:28 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Nov 2007 07:10:28 -0000 Authentication-Results: pb1.pair.com header.from=m@digitalsandwich.com; sender-id=softfail Authentication-Results: pb1.pair.com smtp.mail=m@digitalsandwich.com; spf=softfail; sender-id=softfail Received-SPF: softfail (pb1.pair.com: domain digitalsandwich.com does not designate 68.230.241.44 as permitted sender) X-PHP-List-Original-Sender: m@digitalsandwich.com X-Host-Fingerprint: 68.230.241.44 fed1rmmtao102.cox.net Solaris 10 (beta) Received: from [68.230.241.44] ([68.230.241.44:64810] helo=fed1rmmtao102.cox.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 46/B0-31009-0E631474 for ; Mon, 19 Nov 2007 02:10:26 -0500 Received: from fed1rmimpo01.cox.net ([70.169.32.71]) by fed1rmmtao102.cox.net (InterMail vM.7.08.02.01 201-2186-121-102-20070209) with ESMTP id <20071119071022.LESY6284.fed1rmmtao102.cox.net@fed1rmimpo01.cox.net> for ; Mon, 19 Nov 2007 02:10:22 -0500 Received: from [192.168.0.102] ([68.96.248.22]) by fed1rmimpo01.cox.net with bizsmtp id EXAN1Y0020Vk8yk0000000; Mon, 19 Nov 2007 02:10:22 -0500 Message-ID: <4740C654.3020302@digitalsandwich.com> Date: Sun, 18 Nov 2007 23:10:12 +0000 User-Agent: Thunderbird 2.0.0.6 (X11/20071108) MIME-Version: 1.0 To: internals@lists.php.net Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] late static binding php6 From: m@digitalsandwich.com (Mike Lively) Stanislav Malyshev wrote: >> I realize that instance calls are a completely different ball game than >> static calls but LSB was supposed to give us the same flexibility. > > Actually, I don't think it was. If you want objects, why not use the > real thing? LSB was created to solve just one particular problem - > inability to distinguish A::method() from B::method() if B extends A. Being one of the original people requesting this I would have to say that you aren't completely accurate in that statement. That may have been the goals of the most recent patch's collaborators but it certainly wasn't mine. The reason I originally wanted it was because the way statics were originally implemented was too rigid to do things that I wanted to with them. LSB was a way to provide a flexible inheritance model for static classes. This would allow for the framework creator's dream of not having to instantiate objects for the sole purpose of instantiating new objects: $model = new Author(); $more_models = $model->findByName('Mike'); Instead you could place your 'factory' code into a base class as a static and extend it appropriately. This goal was met, but with yet another severe limitation in that you lose the ability to reimplement after you extend. In my opinion this is foundational to object oriented design and I know that alot of people agree with me. So in that vain what's wrong with going the full length on a new feature that isn't set in stone? > >> called class on. It would allow more complex forms of inheritanc > "more complex" is not always better. Rest assured that this is not the bad kind of 'more complex' I believe that with a large number of OO programmers this is going to be more natural. Bear in mind that this patch is in a large part geared to please those people that though self:: should have referred to the calling class to begin with. I can all but guarantee that you will be hearing the same arguments about 'parent::' within a fairly short amount of time after 5.3 goes out. Maybe then we will talk about 'Later Static Binding' :P.