Re: [RFC][Vote] Return Types
| From: | Andrea Faulds | Date: | Thu, 06 Nov 2014 15:00:39 +0000 |
| Subject: | Re: [RFC][Vote] Return Types | ||
| References: | 1 2 3 4 5 6 7 8 9 10 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-78820@lists.php.net to get a copy of this message | ||
> On 6 Nov 2014, at 07:43, Dmitry Stogov <dmitry@zend.com> wrote:
>
> It may be a serious new problem. For example you won't be able to compile
> the following code at all?
>
> <?php
> class A {
> function foo(): C {}
> }
> class B extends A {
> function foo(): C {}
> }
> class C extends B {
> function foo(): C {}
> }
> ?>
>
> The similar code with argument type hinting works fine.
> It's just a first example I could imagine, I believe, we will get more...
I can't see any reason that example wouldn't work. The types didn't change, so
there's no class loading needed for the covariance check.
--
Andrea Faulds
http://ajf.me/