Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:38547 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 56178 invoked from network); 23 Jun 2008 17:03:12 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Jun 2008 17:03:12 -0000 Authentication-Results: pb1.pair.com smtp.mail=stas@zend.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=stas@zend.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 212.25.124.162 as permitted sender) X-PHP-List-Original-Sender: stas@zend.com X-Host-Fingerprint: 212.25.124.162 mail.zend.com Windows 2000 SP4, XP SP1 Received: from [212.25.124.162] ([212.25.124.162:39441] helo=mx1.zend.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D2/9B-03212-E47DF584 for ; Mon, 23 Jun 2008 13:03:11 -0400 Received: from us-ex1.zend.com ([192.168.16.5]) by mx1.zend.com with Microsoft SMTPSVC(6.0.3790.3959); Mon, 23 Jun 2008 20:03:20 +0300 Received: from [192.168.16.110] ([192.168.16.110]) by us-ex1.zend.com with Microsoft SMTPSVC(6.0.3790.3959); Mon, 23 Jun 2008 09:57:24 -0700 Message-ID: <485FD5E5.6070002@zend.com> Date: Mon, 23 Jun 2008 09:57:09 -0700 Organization: Zend Technologies User-Agent: Thunderbird 2.0.0.14 (Windows/20080421) MIME-Version: 1.0 To: Etienne Kneuss CC: PHP internals References: <485C5081.1050609@zend.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 23 Jun 2008 16:57:24.0922 (UTC) FILETIME=[35F321A0:01C8D552] Subject: Re: [PHP-DEV] LSB forward_static_call() From: stas@zend.com (Stanislav Malyshev) Hi! > 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. There's nothing wrong with functions - call_user_* are functions too, and func_get_args(), etc. > 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. If we have problem with using call_user_* with references, that should be fixed (do we have description of what exactly is missing - like bug report or RFC or something?) But it won't be fixed by changing parent::, so how it's relevant here? > 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();. Why having parent:: at all then? You could always use the class name, right? But for some reason we do have parent:: - and that reason is that using explicit class name is not a good style in this context, it both obscures the intent and makes unnecessary dependencies in the code. Now imagine on top of that we have name:: and parent:: work differently, so you don't have choice but using name:: for certain things. > 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. I do not think extra CPU instruction or two is really the factor here. We are talking about high-level language, not assembly language. -- Stanislav Malyshev, Zend Software Architect stas@zend.com http://www.zend.com/ (408)253-8829 MSN: stas@zend.com