Re: Anonymous functions inside static methods.
| From: | Levi Morrison | Date: | Sun, 11 May 2014 03:18:21 +0000 |
| Subject: | Re: Anonymous functions inside static methods. | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-74119@lists.php.net to get a copy of this message | ||
On Sat, May 10, 2014 at 9:12 PM, Levi Morrison <morrison.levi@gmail.com>wrote:
>
> > I think Bar::bar() should definitely return 'Bar' (currently returns
> > 'Foo') but what about the Bar::Baz() call?
>
> I kinda agree, but that ship has sailed and it would be a BC break.
>
Yes... but we fix bugs all the time that are technically BC breaks. Do you
really think we shouldn't fix this?
I note in your 3v4l that HHVM does not follow the same rules.
>
I think HHVM gets the Bar::bar() case correct and we should fix it.
I'm not sure if I agree with HHVM's outcome on Bar::baz(). To me the
closure is non-static which means it won't invoke late static binding. This
is something I'd like to discuss; what do you guys think about that?
Another option is to implicitly promote closures inside of static contexts
to be also be static; this is basically what HHVM does.