Re: [RFC] Return Type Declarations

From: Date: Thu, 24 Apr 2014 17:59:04 +0000
Subject: Re: [RFC] Return Type Declarations
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-73779@lists.php.net to get a copy of this message
On Thu, Apr 24, 2014 at 4:59 PM, Levi Morrison <levim@php.net> wrote:
> My dear Internals friends,
>
> I have spent the last month drafting an RFC that allows return types:
> https://wiki.php.net/rfc/returntypehinting
>
> Notable items:
>   -  Differences from past RFCs are summarized in the RFC:
> https://wiki.php.net/rfc/returntypehinting#differences_from_past_rfcs
>   - The patch includes basic opcache and reflection support. It also has
> phpt tests.
>   - Informal performance tests indicate that the patch did not fubar
> performance; if desired a more detailed test can be conducted before voting.
>   - 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.
>
> As a friendly reminder, everyone on this list is interested in developing a
> better PHP and the definitions of 'better' vary from person to person.
> Please be civil and constructive while discussing this RFC. Thank you!
>
> Some thanks, regardless if the RFC is accepted:
>   - For providing a patch: Joe Watkins.
>   - For helping me iterate on RFC drafts: Bob Wienand, Nikita Popov and
> Anthony Ferrara
>   - For previous RFCs on this topic: Felipe Pena and Will Fitch. I gleaned
> valuable knowledge from your proposals and the discussion around them.


This will come in very handy over at the PHP-FIG, as we can specify
return types for interface methods instead of just type hinting parameters.

All for it. This has been done in a way that is fully BC, resolves any
of the previous complaints, offers useful functionality, does not bite
off more than it can chew, ignores the whole "nullable AND specific
type" black hole and gets the job done.

Best of luck with this one Levi.


Thread (28 messages)

« previous php.internals (#73779) next »