This function is used to get the mime type of any given file. The intended purpose was to have it working within any of our servers that vary from the latest PHP version down to PHP 4./** * Get the mime type for any given file. * * @param str $filename Path to the file including the filename * * @return mixed bol|arr Either false or the array provided by the PHP function */function getMimeType($filename) {  $mimetype = false;  if (function_exists('finfo_fopen')) {    $mimetype = finfo_fopen($filename);  } elseif (function_exists('getimagesize')) {    $mimetype = getimagesize($filename);  } elseif (function_exists('exif_imagetype')) {    $mimetype = exif_imagetype($filename);  } elseif (function_exists('mime_content_type')) {    $mimetype = mime_content_type($filename);  }  return $mimetype;}While the function is already tested on different PHP versions, I'm trying to ascertain if the methodology implemented can be improved, thus leading to code reduction and preventing any redundant verifications.Can this function receive any type of improvement?
Detecting the mime type using an agnostic method
php