public static function hasLineLongerThanMax($str) { //+2 to include CRLF line break for a 1000 total return (bool) preg_match('/^(.{' . (self::MAX_LINE_LENGTH + 2) . ',})/m', $str); }