Globals are bad! But should I use them in this context?

Posted by Matt on Stack Overflow See other posts from Stack Overflow or by Matt
Published on 2010-05-30T00:09:57Z Indexed on 2010/05/30 0:22 UTC
Read the original article Hit count: 492

Filed under:
|
|

Would setting the $link to my database be one thing that I should use a GLOBAL scope for? In my setting of (lots of functions)...it seems as though having only one variable that is in the global scope would be wise.

I am currently using the functions to transfer it back and forth so that way I do not have it in the global scope. But it is a bit of a hindrance to my script.

Please advise.

© Stack Overflow or respective owner

Related posts about php

Related posts about scope