To make an empty function, which only accepts arrays, one can use type-hinting:
<?php
// emptyArray :: [a] -> Bool
function emptyArray(array $xs){
return empty($xs);
}
?>
Type hinting is a good thing to use in your code, because it makes it more easy to reason about your code. Besides that, it automatically documents the code.