Re: Binding object instances to static closures
| From: | David Harkness | Date: | Fri, 31 May 2013 19:00:03 +0000 |
| Subject: | Re: Binding object instances to static closures | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-321308@lists.php.net to get a copy of this message | ||
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@xstudiosinc.com>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