When is a global not a global?
| From: | Nick Wilson | Date: | Wed, 12 Jul 2006 22:52:27 +0000 |
| Subject: | When is a global not a global? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-239394@lists.php.net to get a copy of this message | ||
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