Re: [RFC][Vote] Return Types
| From: | Christoph Becker | Date: | Tue, 04 Nov 2014 08:37:41 +0000 |
| Subject: | Re: [RFC][Vote] Return Types | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-78615@lists.php.net to get a copy of this message | ||
Ivan Enderlin @ Hoa wrote:
> Excellent RFC, thank you. However, there is no mention about using
>
static, self or
> parent as a type (it is possible for an argument).
> Something like:
> ```php
> class Singleton {
>
> public function getInstance ( $x, $y): static { … }
> }
> ```
> Maybe I miss it in the discussion?
> Thoughts?
The possible usage of self and parent is already documented:
<https://wiki.php.net/rfc/returntypehinting#differences_from_past_rfcs>.
Regarding static, see <http://news.php.net/php.internals/78116>.
--
Christoph M. Becker