PHP global in functions

Globals are evil This is true for the global keyword as well as everything else that reaches from a local scope to the global scope (statics, singletons, registries, constants). You do not want to use them. A function call should not have to rely on anything outside, e.g. function fn() { global $foo; // never … Read more