Would be possible to specify a default argument value when argument is a PHP closure? Like:
public function getCollection($filter = function($e) { return $e; })
{
// Stuff
}
Am i missing something (maybe a different syntax?) or it's not possible at all? Of course i know i can do:
public function getCollection($filter = null)
{
$filter = is_callable($filter) ? $filter : function($e) { return $e; };
// Stuff
}
(NOTE: I didn't test the above code)