What are the advantages and disadvantages of using switch statements for file inclusion in PHP?

Switch statements can be used for file inclusion in PHP to easily determine which file to include based on a specific condition. This can make the code more organized and easier to maintain compared to using multiple if-else statements. However, using switch statements for file inclusion can lead to potential security risks if the condition is based on user input, as it may allow for directory traversal attacks.

$include_file = 'default.php';

switch ($condition) {
    case 'file1':
        $include_file = 'file1.php';
        break;
    case 'file2':
        $include_file = 'file2.php';
        break;
    // add more cases as needed
}

include $include_file;