What are the potential consequences of including a large PHP file on every page, in terms of server load and memory usage?

Including a large PHP file on every page can significantly increase server load and memory usage, as the server has to process and execute the entire file each time a page is loaded. This can slow down the website and potentially lead to performance issues, especially if the file contains unnecessary code or functions that are not needed on every page. To mitigate this issue, it is recommended to refactor the code and only include the necessary functions or code snippets on each page where they are actually needed.

// Example of refactoring the code to include only necessary functions on each page

// Page 1
require_once('functions.php');
echo do_something();

// Page 2
require_once('functions.php');
echo do_something_else();