Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:40563 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 16161 invoked from network); 19 Sep 2008 10:31:20 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Sep 2008 10:31:20 -0000 Authentication-Results: pb1.pair.com smtp.mail=dmitry@zend.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=dmitry@zend.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 212.25.124.163 as permitted sender) X-PHP-List-Original-Sender: dmitry@zend.com X-Host-Fingerprint: 212.25.124.163 il-gw1.zend.com Windows 2000 SP4, XP SP1 Received: from [212.25.124.163] ([212.25.124.163:17787] helo=il-gw1.zend.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 71/48-08965-67F73D84 for ; Fri, 19 Sep 2008 06:31:19 -0400 Received: from ws.home ([10.1.1.1]) by il-gw1.zend.com with Microsoft SMTPSVC(6.0.3790.3959); Fri, 19 Sep 2008 13:31:17 +0300 Message-ID: <48D37F71.3030407@zend.com> Date: Fri, 19 Sep 2008 14:31:13 +0400 User-Agent: Thunderbird 2.0.0.16 (X11/20080723) MIME-Version: 1.0 To: Alain Williams CC: Ionut Gabriel Stan , internals@lists.php.net References: <962975.69490.qm@web36405.mail.mud.yahoo.com> <20080918183855.GB30186@mint.phcomp.co.uk> In-Reply-To: <20080918183855.GB30186@mint.phcomp.co.uk> X-Enigmail-Version: 0.95.7 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 19 Sep 2008 10:31:17.0254 (UTC) FILETIME=[D94B8A60:01C91A42] Subject: Re: [PHP-DEV] php7- dropping the $ from the variable name - rfc From: dmitry@zend.com (Dmitry Stogov) Alain Williams wrote: > On Thu, Sep 18, 2008 at 11:30:37AM -0700, Ionut Gabriel Stan wrote: > >> Actually, I somehow understand what he wants, considering we'll soon have lambdas and closures. I mean, in case of javascript a variable can hold as well a function as it can hold anything else. >> Anyway, I don't think this is the case for PHP. I do find it ugly to write $function(), but I guess I'll live with it as I did until now. > > So if you drop the '$' the way that you call a function referenced in variable > 'funref' is not: > > $funref() > > but > > funref() > > However: the PHP parser will take that to be a call to a function named 'funref'. > So you need to change the syntax to, perhaps, something like C: > > (funref)() > > I can't see people understanding that. > Stick with what we have. > There is no difference between a function and a variable which holds a closure in many languages (e.q. JavaScript, LUA, ...), so you don't need any extra syntax rules. function foo() { } foo(); var bar = function() { } bar(); It's not possible to make the same unification with PHP's $, however I don't see a way to remove $. Thanks. Dmitry.