Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:38498 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 6073 invoked from network); 21 Jun 2008 17:32:28 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 21 Jun 2008 17:32:28 -0000 Authentication-Results: pb1.pair.com header.from=ekneuss@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=ekneuss@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.132.250 as permitted sender) X-PHP-List-Original-Sender: ekneuss@gmail.com X-Host-Fingerprint: 209.85.132.250 an-out-0708.google.com Received: from [209.85.132.250] ([209.85.132.250:6291] helo=an-out-0708.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 12/70-26505-B2B3D584 for ; Sat, 21 Jun 2008 13:32:27 -0400 Received: by an-out-0708.google.com with SMTP id c14so360523anc.1 for ; Sat, 21 Jun 2008 10:32:24 -0700 (PDT) Received: by 10.101.71.9 with SMTP id y9mr7567934ank.145.1214038699708; Sat, 21 Jun 2008 01:58:19 -0700 (PDT) Received: by 10.151.83.19 with HTTP; Sat, 21 Jun 2008 01:58:19 -0700 (PDT) Message-ID: Date: Sat, 21 Jun 2008 10:58:19 +0200 Sender: ekneuss@gmail.com To: "Stanislav Malyshev" Cc: "PHP internals" In-Reply-To: <485C5081.1050609@zend.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <485C5081.1050609@zend.com> X-Google-Sender-Auth: 992b95828634e360 Subject: Re: [PHP-DEV] LSB forward_static_call() From: colder@php.net ("Etienne Kneuss") Hello, On Sat, Jun 21, 2008 at 2:51 AM, Stanislav Malyshev wrote: > Hi! > >> So, I really would like to revert that foward_static_call stuff and >> implement the parent:: patch instead, while it's still possible. >> >> thoughts? > > Didn't we discuss that already? Adding magic to parent:: is not a good > idea, it's very basic language construct and should work simple. LSB is > an advanced feature, which probably would be used deep inside library guts > and thus can use more elaborate syntax. It seems natural to think of LSB as a language feature, and so it doesn't feel right to have it partly implemented as a keyword, and then fix the problematic part as function. We already see how call_user_func is painful to use (i.e. with methods that use references), that same burden will be put on forward_static_call. > On top of that, by making parent:: forward called class name, you remove > the possibility of doing non-forwarding call to the parent class. Why would that be no longer possible ? If you want to make a non-forwarding call to the parent class, you can use TheParentClassName::foo();. > > As for it being slow - how slow it is? Does it really so slow that it > makes real-life application that otherwise would be fast to be slow? Or > it's just "couple more CPU cycles" slow? I suspect the latter - and thus > I don't think speed optimizations belong there. It's about 85% slower than a direct call. Sure it's not that slow when measuring absolutely, but we're talking about a feature that will be typically used in frameworks and libraries, so the amount of calls may be quite big. > -- > Stanislav Malyshev, Zend Software Architect > stas@zend.com http://www.zend.com/ > (408)253-8829 MSN: stas@zend.com > > > -- Etienne Kneuss http://www.colder.ch Men never do evil so completely and cheerfully as when they do it from a religious conviction. -- Pascal