Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:72955 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 69087 invoked from network); 5 Mar 2014 23:17:46 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Mar 2014 23:17:46 -0000 Authentication-Results: pb1.pair.com header.from=narf@devilix.net; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=narf@devilix.net; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain devilix.net designates 209.85.160.170 as permitted sender) X-PHP-List-Original-Sender: narf@devilix.net X-Host-Fingerprint: 209.85.160.170 mail-yk0-f170.google.com Received: from [209.85.160.170] ([209.85.160.170:56522] helo=mail-yk0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D1/00-03343-990B7135 for ; Wed, 05 Mar 2014 18:17:45 -0500 Received: by mail-yk0-f170.google.com with SMTP id 9so4629319ykp.1 for ; Wed, 05 Mar 2014 15:17:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=devilix.net; s=google; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=+j2YvdTU2XtoxECRYR2G31s6WJUDuS17ToFUDnlhluw=; b=P1neGcXmYOWtVJuV/H/pVm7QpxP6Tc+G/CFl7gXF4dXzIxh/56x39sPnymYNhPYqil KRxCEvFO/7ddlFy4CaGz89BxPSDwYQh/dfIRO08RayH/K2P3mgkaQ6c8lKmXLtas92Ac H34PCD1P8BGfQhzF09ojZ6qDqThBCBpRu2rbE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=+j2YvdTU2XtoxECRYR2G31s6WJUDuS17ToFUDnlhluw=; b=hWGBfRfpv76YxQHxnE1aAPkiCOdymBU7OjEzUCBy5617m6VlZnDYbbgz3GWnTOUtaG CW7OPl8P9aRtS4TR6JoLRSs74VIgqOGPJZ7l9AQZZ4Ekx5dJVB6cvqeR4r8GObCfDSlQ WOr3H3nywqASHGq3wXr/ZEr+3tcDs4hkcKFUX7mskxocxT1ik6yhpoBQmfiyGLjAukc7 tb1ghqxtIuIpJA86Y/ypgVUhXZAKTM91P7KRTEp/2pYeAV17oJWTidoec8BgNxetEnN9 Ar6UGJThVvIsLFcrcmiumwgUBqOO3Xd3oSb/i1REfVXLJnn241srZIKu2OymbExNp8UX cgWw== X-Gm-Message-State: ALoCoQlMlcSwHDEVx0CDpruaf6EzkhOgAuRO4z0AJdX0SizMHCLg9sjRMlZ6AJ7+aW72nnP9e6Jr MIME-Version: 1.0 X-Received: by 10.236.120.147 with SMTP id p19mr10686808yhh.6.1394061462050; Wed, 05 Mar 2014 15:17:42 -0800 (PST) Received: by 10.170.188.139 with HTTP; Wed, 5 Mar 2014 15:17:41 -0800 (PST) In-Reply-To: <5317ABEB.4020402@sugarcrm.com> References: <5317A479.4020102@sugarcrm.com> <5317ABEB.4020402@sugarcrm.com> Date: Thu, 6 Mar 2014 01:17:41 +0200 Message-ID: To: Stas Malyshev Cc: "internals@lists.php.net" Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] T_AS in closures From: narf@devilix.net (Andrey Andreev) On Thu, Mar 6, 2014 at 12:57 AM, Stas Malyshev wrote: > 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. So, exclude foreach() from my argument and all of a sudden we do have consistency. >> 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. I didn't need education on that, but to your credit - I like how you always manage to twist arguments to your own liking. :) You know I meant that in the context of renaming. Anyway, got it: -1 from you. Cheers, Andrey.