Re: Anonymous functions inside static methods.

From: Date: Thu, 08 May 2014 23:43:45 +0000
Subject: Re: Anonymous functions inside static methods.
References: 1  Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message
> 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)

« previous php.internals (#74075) next »