What are the alternative methods to include external files in PHP scripts for better performance and maintainability?

Including external files in PHP scripts can lead to better performance and maintainability by breaking up code into smaller, reusable components. One alternative method is to use PHP's `include_once` or `require_once` functions to include files only once to prevent duplicate code execution. Another method is to use autoloading with Composer to automatically load classes as needed, reducing the need for manual includes.

// Using include_once or require_once to include external files
include_once 'header.php';
require_once 'functions.php';

// Using Composer autoloading to load classes
require 'vendor/autoload.php';