When you use type-hinting (only array
interface
s, and class
es can be type-hinted /till php 5.6/. /since 7.0 it is possible to typehint scalar types as well/), you can set the default value of the parameter to null. If you want to, let the parameter be optional.
$something = 'is_numeric';
$nothing = null;
function myFunction(Callable $c = null){
//do whatever
}
All works:
myFunction();
myFunction($nothing);
myFunction($something);
Read more here: http://php.net/manual/en/language.oop5.typehinting.php