Re: Anonymous functions inside static methods.
> 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.
You can do $foo->bindTo(null,Bar) even if the closure is static.
Actually, it seems that when you call the parent function statically,
the child closure is considered static no matter what else you do. So
even force-running a parent function statically at runtime
(disregarding the warning) means it and its child closures will
behave as if they had the static
keyword.
I note in your 3v4l that HHVM does not follow the same rules.
-- S.
Thread (9 messages)