public static function firstLine($filepath)
    {
        if (file_exists($filepath)) {
            $cacheRes = fopen($filepath, 'rb');
            $firstLine = fgets($cacheRes);
            fclose($cacheRes);

            return $firstLine;
        }

        return null;
    }
public static function firstLine($filepath)
    {
        if (file_exists($filepath)) {
            $cacheRes = fopen($filepath, 'rb');
            $firstLine = fgets($cacheRes);
            fclose($cacheRes);

            return $firstLine;
        }

        return null;
    }
public static function firstLine ( $ filepath ) { if ( file_exists ( $ filepath ) ) { $ cacheRes = fopen ( $ filepath , 'rb' ) ; $ firstLine = fgets ( $ cacheRes ) ; fclose ( $ cacheRes ) ; return $ firstLine ; } return null ; }
Quickest way for getting first file line

@param string $filepath
@return string|null
Quickest way for getting first file line