Re: [RFC] Allow "use( $longname as $alias)" syntax for closures declaration
| From: | Laruence | Date: | Fri, 13 Apr 2012 08:14:49 +0000 |
| Subject: | Re: [RFC] Allow "use( $longname as $alias)" syntax for closures declaration | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-59859@lists.php.net to get a copy of this message | ||
On Fri, Apr 13, 2012 at 4:10 PM, Verbitsky Alexander
<verbitsky_alexandr@mail.by> wrote:
> On 04/12/2012 06:38 PM, Laruence wrote:
>>
>> Hi:
>> I have made a RFC to allow user use T_AS in the closure declaration,
>> like:
>>
>> function () use($long as $l,&$long as $r) {
>>
>> }
>>
>> here is the RFC: https://wiki.php.net/rfc/useas
>>
>> any ideas? thanks
>>
> Closure is a functional literal that can pull with itself all variables
> visible in current scope where it was created.
Hi:
you mean dup a EG(active_symbol_table)? it's too expensive, IMO.
thanks
> For my opinion using keyword
> 'use' is not necessary and i would have removed it. If you need different
> name of variable maybe you need anonymous function.
>
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--
Laruence Xinchen Hui
http://www.laruence.com/