Ive often wondered this, and thought it would be a good time to ask
Why shouldnt you use GLOBALS?
Loads of forums say dont use GLOBAL variables, however are we saying pass the variables into the functions?
For example if I have a $db object (which hold the connection credentials etc for a database) which I want to use in another function, for I need to pass the reference $db into the function, or surly its better to define $db as a global variable and use it in my second function.
I've read articles which suggest NEVER NEVER NEVER use Globals, but surely passing the reference $db into a function isnt/shouldnt be good practice? Or am I thinking wrong here?