Newsgroups: php.internals,php.internals Path: news.php.net Xref: news.php.net php.internals:33251 php.internals:33252 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 90312 invoked by uid 1010); 18 Nov 2007 13:36:05 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 90296 invoked from network); 18 Nov 2007 13:36:05 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Nov 2007 13:36:05 -0000 Authentication-Results: pb1.pair.com smtp.mail=johannes@php.net; spf=unknown; sender-id=unknown Authentication-Results: pb1.pair.com header.from=johannes@php.net; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain php.net does not designate 83.243.58.163 as permitted sender) X-PHP-List-Original-Sender: johannes@php.net X-Host-Fingerprint: 83.243.58.163 mail4.netbeat.de Received: from [83.243.58.163] ([83.243.58.163:41189] helo=mail4.netbeat.de) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 02/63-00464-4CF30474 for ; Sun, 18 Nov 2007 08:36:05 -0500 Received: (qmail 20897 invoked by uid 507); 18 Nov 2007 13:36:00 -0000 Received: from unknown (HELO ?192.168.1.102?) (postmaster%schlueters.de@62.245.209.237) by mail4.netbeat.de with ESMTPA; 18 Nov 2007 13:36:00 -0000 To: "\"Etienne Kneuss\"" Cc: Gergely Hodicska , internals@lists.php.net In-Reply-To: References: <474021AD.3020902@avalon.aut.bme.hu> Content-Type: text/plain; charset=utf-8 Date: Sun, 18 Nov 2007 14:35:58 +0100 Message-ID: <1195392958.4012.15.camel@johannes.nop> Mime-Version: 1.0 X-Mailer: Evolution 2.12.1 (2.12.1-3.fc8) Content-Transfer-Encoding: 8bit Subject: Re: [PHP-DEV] late static binding php6 From: johannes@php.net (Johannes =?ISO-8859-1?Q?Schl=FCter?=) Hi, and for me the current behavior feels right: The call to parrent::findByPk() is an independent call from the call before and calls an explicit class (the parent one) johannes On Sun, 2007-11-18 at 14:21 +0100, "Etienne Kneuss" wrote: > Hello, > > this very subject was already discussed in a thread months ago. Basically, > it's a matter of choice whether fully established calls should break the > resolution or not. Both ways have drawbacks. Implementing both would require > yet another keyword and complications. > > > On Nov 18, 2007 12:27 PM, Gergely Hodicska wrote: > > > Hi! > > > > > > I read this thread, and I would like to ask if is there any decision > > about the behavior of inheritance? > > > > I wrote on my blog about late static binding > > ( > > http://blog.felho.hu/what-is-new-in-php-53-part-2-late-static-binding.html > > ), > > and I came up with the following example: > > > > > class ActiveRecord > > { > > public static function findByPk($id) > > { > > $calledClass = get_called_class(); > > // The magic remains... > > } > > } > > > > class Blog extends ActiveRecord > > { > > public static function findByPk($id) > > { > > // We want to log something. > > > > // Then the parent should do the magic. > > parent::findByPk($id); > > } > > } > > > > Blog::findByPk(1); > > ?> > > > > > > In think it would be nice if I could write codes like this. But in the > > current snapshot the value of $calledClass is ActiveRecord. > > > > > > Best Regards, > > Felhő > > > > -- > > PHP Internals - PHP Runtime Development Mailing List > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > > >