How can the use of variables and functions in separate PHP files impact code execution and avoid conflicts?

When variables and functions are defined in separate PHP files, it helps organize the code and avoid naming conflicts. By including these files only when needed, we can prevent duplicate declarations and improve code readability. This practice also allows for better code reusability and maintainability.

// variables.php
$variable1 = "Hello";
$variable2 = "World";

// functions.php
function greet() {
    global $variable1, $variable2;
    echo $variable1 . " " . $variable2;
}

// main.php
include 'variables.php';
include 'functions.php';

greet();