Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:33304 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 30173 invoked by uid 1010); 19 Nov 2007 12:28:07 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 30157 invoked from network); 19 Nov 2007 12:28:06 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Nov 2007 12:28:06 -0000 Authentication-Results: pb1.pair.com smtp.mail=mls@pooteeweet.org; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=mls@pooteeweet.org; sender-id=unknown Received-SPF: error (pb1.pair.com: domain pooteeweet.org from 85.10.196.195 cause and error) X-PHP-List-Original-Sender: mls@pooteeweet.org X-Host-Fingerprint: 85.10.196.195 serveforce1.backendmedia.com Linux 2.6 Received: from [85.10.196.195] ([85.10.196.195:42593] helo=serveforce1.backendmedia.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 57/11-23144-45181474 for ; Mon, 19 Nov 2007 07:28:05 -0500 Received: from [192.168.5.106] (cust.static.84-253-51-151.cybernet.ch [84.253.51.151]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (Client did not present a certificate) by serveforce1.backendmedia.com (Postfix) with ESMTP id 4FCE2181CFB3; Mon, 19 Nov 2007 13:28:28 +0100 (CET) In-Reply-To: <474021AD.3020902@avalon.aut.bme.hu> References: <474021AD.3020902@avalon.aut.bme.hu> Mime-Version: 1.0 (Apple Message framework v752.3) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-ID: <06685887-B14F-4933-8F71-DFAB0D9B0E53@pooteeweet.org> Cc: internals@lists.php.net Content-Transfer-Encoding: 7bit Date: Mon, 19 Nov 2007 13:27:50 +0100 To: Gergely Hodicska X-Mailer: Apple Mail (2.752.3) X-backendmedia-com-MailScanner-Information: Please contact the ISP for more information X-backendmedia-com-MailScanner: Found to be clean X-backendmedia-com-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=0, required 6) X-backendmedia-com-MailScanner-From: mls@pooteeweet.org X-Spam-Status: No Subject: Re: [PHP-DEV] late static binding php6 From: mls@pooteeweet.org (Lukas Kahwe Smith) On 18.11.2007, at 12:27, 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); > ?> I think the point of Stas reply was to use self:: instead of parent::. regards, Lukas