Indeed.
The main problem of using globals is that it's very difficult to find out where they are used, and what they are used for.
Imagine this:
$sMyGlobal = "apples";
$sBananas = "bananas";
fckMeUpScotty();
echo $sMyGlobal;
and when you run it it outputs "bananas"....
Can you tell what fckMeUpScotty() does to any of the variables?
No you can't.
So you have to look at the function, which is included from a file 354 directories further down the filetree:
function fckMeUpScotty()
{
global $sMyGlobal;
global $sBananas;
$sMyGlobal = $sBananas;
};
See how confusing it can be?
Imagine doing that with 40 scripts and 200 functions.
TIP: Only use globals to contain READ-ONLY data, like configuration data, database names, HTML-style colors etc. Things that you only read from, but NEVER write to.
Always make your function so that they return their output either through the return-value or through the function parameters.