Globals not working within a function in C5.6

Permalink
I have the following test code inside a view.php:

$tt = 10;
print_r("tt: " . $tt . "<br>");
// Get vertical space needed
function test() {
  global $line_offset;
  global $tt;
  print_r("tt inside: " . $tt . "<br>");
}
print_r("I am here<br>");        
test(); exit;


The $tt is empty inside the function. Am I missing something in how globals are use? On my server, outside of C5, the test function works.

Todd

rtcary