Re: T_AS in closures
| From: | Andrey Andreev | Date: | Wed, 05 Mar 2014 23:17:41 +0000 |
| Subject: | Re: T_AS in closures | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-72955@lists.php.net to get a copy of this message | ||
On Thu, Mar 6, 2014 at 12:57 AM, Stas Malyshev <smalyshev@sugarcrm.com> 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.