public static function getFileContents(string $pathAndFilename, int $flags = 0, $context = null, int $offset = null, int $maximumLength = -1)
    {
        if ($flags === true) {
            $flags = FILE_USE_INCLUDE_PATH;
        }
        try {
            if ($maximumLength > -1) {
                $content = file_get_contents($pathAndFilename, $flags, $context, $offset, $maximumLength);
            } else {
                $content = file_get_contents($pathAndFilename, $flags, $context, $offset);
            }
        } catch (ErrorException $ignoredException) {
            $content = false;
        }
        return $content;
    }
public static function getFileContents(string $pathAndFilename, int $flags = 0, $context = null, int $offset = null, int $maximumLength = -1)
    {
        if ($flags === true) {
            $flags = FILE_USE_INCLUDE_PATH;
        }
        try {
            if ($maximumLength > -1) {
                $content = file_get_contents($pathAndFilename, $flags, $context, $offset, $maximumLength);
            } else {
                $content = file_get_contents($pathAndFilename, $flags, $context, $offset);
            }
        } catch (ErrorException $ignoredException) {
            $content = false;
        }
        return $content;
    }
public static function getFileContents ( string $ pathAndFilename , int $ flags = 0 , $ context = null , int $ offset = null , int $ maximumLength = - 1 ) { if ( $ flags === true ) { $ flags = FILE_USE_INCLUDE_PATH ; } try { if ( $ maximumLength > - 1 ) { $ content = file_get_contents ( $ pathAndFilename , $ flags , $ context , $ offset , $ maximumLength ) ; } else { $ content = file_get_contents ( $ pathAndFilename , $ flags , $ context , $ offset ) ; } } catch ( ErrorException $ ignoredException ) { $ content = false ; } return $ content ; }
An enhanced version of file_get_contents which intercepts the warning
issued by the original function if a file could not be loaded.

@param string $pathAndFilename Path and name of the file to load
@param integer $flags (optional) ORed flags using PHP's FILE_* constants (see manual of file_get_contents).
@param resource $context (optional) A context resource created by stream_context_create()
@param integer $offset (optional) Offset where reading of the file starts, as of PHP 7.1 supports negative offsets.
@param integer $maximumLength (optional) Maximum length to read. Default is -1 (no limit)
@return mixed The file content as a string or false if the file could not be opened.
@api
An enhanced version of file_get_contents which intercepts the warning issued by the original function if a file could not be loaded .