Question concerning globals...

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Jim
Forum Contributor
Posts: 238
Joined: Fri Apr 19, 2002 5:26 am
Location: Near Austin, Texas

Question concerning globals...

Post by Jim »

This is surely a stupid question, but it's one I can't surmise the answer to.

In code I've seen, in this case Invision Power Board code, stuff like this can be found at the beginning of the script:

Code: Select all

globals $this $that $other;
What exactly does that mean??? Where are these globals defined?

An explanation would be so very welcomed.

Thanks for your help!
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

http://www.php.net/manual/en/language.v ... .scope.php explains it.
those variables can be set anywhere :(
McGruff
DevNet Master
Posts: 2893
Joined: Thu Jan 30, 2003 8:26 pm
Location: Glasgow, Scotland

Post by McGruff »

And: print_r($GLOBALS) will show you what's there in a given script.
Post Reply