What are the advantages of using require_once over include_once in PHP?

When using require_once in PHP, the file must be included for the script to continue running. If the file cannot be included, require_once will produce a fatal error and stop the script execution. On the other hand, include_once will only produce a warning and allow the script to continue running without the included file. Therefore, using require_once ensures that the necessary files are included and that the script will not run into issues due to missing files.

// Using require_once to include a file
require_once 'myfile.php';