Is it a problem if you use the global keyword on variables you don't end up using? Compare:
function foo() {
global $fu;
global $bah;
if (something()) {
$fu->doSomething();
} else {
$bah->doSomething();
}
}
function bar() {
if (something()) {
global $fu;
$fu->doSomething();
} else {
global $bah;
$bah->doSomething();
}
}
I'm quite aware that using the second method makes maintaining this code much harder, and that it's generally preferred to put all your globals at the start of functions, so: Ignoring the difference in maintainability and code-styling of the two functions, is there a difference between these two in terms of overhead?