Re: RFC: Return Types Update
| From: | Nikita Nefedov | Date: | Thu, 16 Oct 2014 14:46:34 +0000 |
| Subject: | Re: RFC: Return Types Update | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-78116@lists.php.net to get a copy of this message | ||
On Thu, 16 Oct 2014 18:39:06 +0400, Davey Shafik <davey@php.net> wrote:
I very much like this — though I would say it was dependent on the nullable types RFC (like splat and variadics were codependent). While I would like to see the introduction of a void type, I understand and respect the limitations on the RFC. However, one thing that I do think is missing, is the equivalent of HacksHi, bar is considered as instance of foo so shouldn't be any problem. Otherwise it would break LSP$thisreturn type. You haveselfandparent, but I think without astaticequivalent you can break things: class foo {static public function instanceOf(): self { return new static(); }} class bar extends foo { } foo::instanceOf(); // new foo, this is fine, returnsself. bar::instanceOf(); // new bar, no longerself