Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:72954 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 66820 invoked from network); 5 Mar 2014 22:57:51 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Mar 2014 22:57:51 -0000 Authentication-Results: pb1.pair.com header.from=smalyshev@sugarcrm.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=smalyshev@sugarcrm.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain sugarcrm.com designates 108.166.43.91 as permitted sender) X-PHP-List-Original-Sender: smalyshev@sugarcrm.com X-Host-Fingerprint: 108.166.43.91 smtp91.ord1c.emailsrvr.com Linux 2.6 Received: from [108.166.43.91] ([108.166.43.91:42302] helo=smtp91.ord1c.emailsrvr.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 6D/52-55049-EEBA7135 for ; Wed, 05 Mar 2014 17:57:51 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp4.relay.ord1c.emailsrvr.com (SMTP Server) with ESMTP id 08B8E1413B3; Wed, 5 Mar 2014 17:57:48 -0500 (EST) X-Virus-Scanned: OK Received: by smtp4.relay.ord1c.emailsrvr.com (Authenticated sender: smalyshev-AT-sugarcrm.com) with ESMTPSA id B68B11413A6; Wed, 5 Mar 2014 17:57:47 -0500 (EST) Message-ID: <5317ABEB.4020402@sugarcrm.com> Date: Wed, 05 Mar 2014 14:57:47 -0800 Organization: SugarCRM User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 MIME-Version: 1.0 To: Andrey Andreev CC: "internals@lists.php.net" References: <5317A479.4020102@sugarcrm.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] T_AS in closures From: smalyshev@sugarcrm.com (Stas Malyshev) Hi! > But this is not about something that can't be achieved with existing > features, it's about cleaner code and to some extent - consistency > with T_AS in foreach(), traits, namespaces; and also how regular There's no issue of consistency there - foreach is not used to "rename variables", foreach is used to iterate. If anything, that is opposite of consistency, since "as" is used in two contradictory roles - for naming iterating variable and for renaming variable without iterating. I don't see how it's any "consistency" to add a new feature while reusing syntax used in existing features for different purposes. > functions would have local-scope names for variables that are passed > to them. Those things are called function parameters, and anonymous functions use them the same way as named functions, no difference there either. And of course anon functions can have local vars too. -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/ (408)454-6900 ext. 227