...what are the diffs between the too?
Global variables can use everywhere in the script, in any function, they will reachable in the whole script, and they will on the memory while the script is running. Local variables will stop when you put the end of the function, if or for, and will delete from the memory. So local variables (and tables also) are better, than global ones.
Quote from: Hungarista on 12 June, 2006, 10:00:33
Global variables can use everywhere in the script, in any function, they will reachable in the whole script, and they will on the memory while the script is running. Local variables will stop when you put the end of the function, if or for, and will delete from the memory. So local variables (and tables also) are better, than global ones.
Thanks!
I wonder, if local variables are deleted from memory on function exit or garbage collection?
On function exit, under normal conditions.
Nicely quoted Mutor, though that only answers the first Markitos' question, and not GeceBekcisi's.
Indeed, I did but I just wanted to be certain.