When is a global not a global?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



hi all, 

After upgrading a CMS, im having a problem with global variables not
showing up anymore -- configs and things could have changed, but search
as i have, i cannot find anything to help me work out what the problem
is. 

This should work of course:

    $foo = 'bar';

    function foobar() {
      global $foo;
      print(" ------ " . $foo);
      exit;
    }

    foobar();

It prints *nothing*. Does anyone have an idea as to what might stop this
from functioning as expected?


-- 
Nick Wilson
http://performancing.com/user/1

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux