Re: Binding object instances to static closures

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thanks Nathaniel for the clarification about 5.4. We are still on 5.3 (and
that only recently), so 5.4 is a ways off in our production systems.
However, I'll read up on this since it may be useful in offline tools.

On Fri, May 31, 2013 at 11:52 AM, Nick Whiting <nwhiting@xxxxxxxxxxxxxxx>wrote:

> TestClass::testMethod(function($param){
>     var_dump($this === $param);
> });
>

I get why closures created inside static methods cannot be bound to an
instance . . . but those created *outside* an object method entirely *can*
be bound? That makes no sense! And yet it works.

David

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux