What potential pitfalls should be considered when including templates within templates in PHP?

When including templates within templates in PHP, a potential pitfall to consider is the risk of variable scope conflicts. To avoid this issue, you can pass variables as parameters to the included template instead of relying on global scope.

// Parent template
$variable = 'Hello';
include 'child_template.php';

// Child template
echo $variable;