What potential pitfalls are associated with using the global keyword in PHP functions?

Using the global keyword in PHP functions can lead to potential pitfalls such as making the code harder to read and maintain, increasing the risk of variable name clashes, and reducing the reusability of the function. To avoid these issues, it's recommended to pass variables as parameters to functions instead of using the global keyword.

// Avoid using global keyword by passing variables as parameters
$globalVar = 'Hello';

function myFunction($var) {
    echo $var;
}

myFunction($globalVar);