View Single Post
Old 05-25-2009, 06:07 AM   #7 (permalink)
Killswitch
The Contributor
 
Join Date: Feb 2007
Posts: 64
Thanks: 9
Killswitch is on a distinguished road
Default

To understand what he is talking about, try looking and studying C++. Variables are much the same, but their scope is very different. I'm not too far into learning the lang myself, but from what I've gathered, in C++, variables can be set to the scope of a block of code ( not just a function, a block of code, such as a loop ). Global variables are those started outside of any code blocks ( again, I am pretty sure about this but might have read incorrectly ).

In Php, you can start a variable inside or outside of a block of code and it does not become global. It only becomes global once you implicitly assign it as global.
Killswitch is offline  
Reply With Quote