global makes a local variable a reference to a variable in the global scope. When you unset inside the function, you're unsetting that reference, not the variable "above".
e.g.
function foo() {
global $bar;
unset($bar);
}
is for the most part doing the same thing as
function foo() {
$bar = &$GLOBALS['bar'];
unset($bar); // kill the local reference, not the global variable.
}
it's just a bit easier on the eyes.