I was reading about Closure interface here:
http://www.php.net/class.closure
Then I googled it and couldn’t find good examples of usage so I decided to post it here. Also there is no example on php.net site as well. Can anyone (probably experienced PHP dev) describe me how and where can I use it to take advantage on it?
The place that immediately sprungs to mind is the various
array_*functions, such asarray_walk(). They are already often used withcreate_function(); the new closure notation makes this existing structure just that little bit more elegant.I’m sure there will be more.