Re: Anonymous functions inside static methods.
There was a reply to this list from Sanford Whiteman which I never
received: http://marc.info/?l=php-internals&m=139959267615452&w=2
Contents posted below:
> 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)