Re: Re: Return Type Declarations
| From: | Adam Harvey | Date: | Thu, 24 Apr 2014 18:09:24 +0000 |
| Subject: | Re: Re: Return Type Declarations | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-73781@lists.php.net to get a copy of this message | ||
On 24 April 2014 11:04, Daniel Lowrey <rdlowrey@php.net> wrote:
>> On Thu, Apr 24, 2014 at 09:59:19AM -0600, Levi Morrison wrote:
>
>>> - This RFC does not add, modify, or remove keywords at all; this notably
>>> excludes type-hints for scalars. Supporting scalar type declarations is
>>> outside the scope of this RFC; if you are interested in supporting scalar
>>> type declarations please discuss it elsewhere.
>
> Addressing scalar return hints in this proposal would be foolish without
> also introducing scalar parameter typing. Beyond that, addressing scalars
> would almost certainly doom the RFC to rejection as scalar typing is like
> the Vietnam of php-src ;)
Maybe the Korea — there are still two sides, years after the war, and
occasional skirmishes. I'd say Unicode was our Vietnam. :)
> At first glance this looks to me like a workable solution precisely because
> it allows progress while avoiding the scalar quagmire.
Same. I haven't looked at the patch yet, but I like how clean (and
limited in scope) this is.
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.
Adam