3 ms·
Closures can now have a `$this` (by default it is the class in which the closure is declared). No more $that = $this hacks :)
by fooyc 15y ago
Closures can now have a `$this` (by default it is the class in which the closure is declared). No more $that = $this hacks :)
- dave1010uk 15y agoThere's also Closure::bindTo() [0], which should allow you do do slightly more functional programming, like JavaScript's Function.apply() [1] [0] http://docs.php.net/manual/en/closure.bindto.php http://docs.php.net/manual/en/closure.bindto.php [1] https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Function/apply https://developer.mozilla.org/en/JavaScript/Reference/Global...