What potential pitfalls should be considered when including a PHP script in another script?

One potential pitfall to consider when including a PHP script in another script is namespace collisions, where variables or functions in the included script may conflict with those in the main script. To avoid this issue, you can encapsulate the included script in a function or class to limit the scope of its variables and functions.

// main_script.php
function includeScript() {
    include 'included_script.php';
}

includeScript();