Re: Re: Return Type Declarations
| From: | Adam Harvey | Date: | Thu, 24 Apr 2014 18:18:16 +0000 |
| Subject: | Re: Re: Return Type Declarations | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-73783@lists.php.net to get a copy of this message | ||
On 24 April 2014 11:15, Levi Morrison <morrison.levi@gmail.com> wrote:
>> Levi, what's the syntax like for closures with use blocks? I can see
>> that looking a bit weird either way, since it's presumably either:
>>
>> function ($foo): Bar use ($quux) {}
>>
>> or:
>>
>> function ($foo) use ($quux): Bar {}
>>
>> Neither are exactly ideal, but that's the hand we've dealt ourselves, I
>> guess.
>
>
> I believe it is the latter: function ($foo) use ($quux): Bar {}
>
> I'll check with Joe Watkins. Do you have a case for one being superior to
> the other?
Not really — I think I prefer that one slightly, but they both require
a moment to parse. On the bright side, I don't see a lot of people
using return type declarations with closures.
Adam