How does the function dirlist handle cases where no value is passed for the $DIR parameter?

When no value is passed for the $DIR parameter in the dirlist function, it may result in an error or unexpected behavior. To handle this case, we can provide a default value for the $DIR parameter within the function definition. This default value will be used if no value is passed when calling the function.

function dirlist($DIR = './') {
    // Function implementation
}