In php 5.3, when you create an anonymous function, can you set the default values?
Like in a normal functon you do
function tim($a=123){
}
where 123 is the default value for $a. What abut in anonymous functions?
UPDATE
I'm having trouble with it in this context:
//$data is an object;
$data->title = 'test';
add_filter('title',function($current, $new = $data->title ){ return $new; });
produces "unexpected T_VARIABLE"
works fine without the $data->title bit, but I really want to pass this in...
add_filter('title',function($current, $new = 'some-title' ){ return $new; });
I'm adding a filter in Wordpress. Works fine if I explicitly set it, but I want to pull it from another variable. Is that possible?