There are two types of varibles in programming languages:
1) global
2) local
Global can be accessed from the whole plugin, while local variables can only be accessed in the function where you declared it.
PHP Code:
new global = 17;
public something(){
new local=32;
//this will write out 17
console_print(0,"%i",global);
//this will print out 32
console_print(0,"%i",local);
}
public other(){
//this will write out 17
console_print(0,"%i",global);
//this will cause an error, because the "local" can only be accessed in the something function
console_print(0,"%i",local);
}