|
|
|
|
|
by mgkimsal
5357 days ago
|
|
Would have preferred something to enable more visually pleasing metaprogramming, like: $closure = function() { echo $this->foo; }; $context = new \StdClass; $context->foo = "Hello World"; $context->closure = $closure; $context->closure(); Not sure if this will be possible in 5.4, but haven't seen anything on it. Right now, we have to do $context->closure = $closure; $temp = $context->closure; $temp(); which is kinda ugly. |
|