Okay, I\'m not sure I\'m understanding this concept properly (I\'m learning PHP). If I understand correctly: Global variables can be referenced anywhere in the same document
If you use only global vars, you'll need to give a new name to every new counter, haha.
The visibility of vars is needed for encapsulation: variable can be affected only by object that you want to have access to it. For example:
class Person{
private $_money;
public function rob(){
return $this->_money;
}
}
Only object of class Person can operate his money, so, if you want them, you have to get mask and gun.