Comment on Underscore.phpparentComments−judofyr15yAlso be aware that anonymous functions do not close over variables unless you specify so: http://php.net/manual/en/functions.anonymous.php−yuvipanda15yAnd they can not close over $this, which is annoying.−fooyc15yIt seems that it's fixed in PHP5.4; $this is the object in which you defined the closure by default, and you can re-bind it to any other object.
Comments
Also be aware that anonymous functions do not close over variables unless you specify so: http://php.net/manual/en/functions.anonymous.php
And they can not close over $this, which is annoying.
It seems that it's fixed in PHP5.4; $this is the object in which you defined the closure by default, and you can re-bind it to any other object.