You can filter the array by checking if the value is an instance of Closure
:
$array = array( 'callback' => function() { die( 'callback'); });
$anon_fns = array_filter( $array, function( $el) { return $el instanceof Closure; });
if( count( $anon_fns) == 0) { // Assumes count( $array) > 0
echo 'No anonymous functions in the array';
} else {
echo 'Anonymous functions exist in the array';
}
Pretty much, just check if the element of the array is an instance of Closure
. If it is, you have a callable type.