Re: Re: Question about superglobals

From: Date: Sat, 17 Nov 2007 01:36:50 +0000
Subject: Re: Re: Question about superglobals
References: 1 2 3 4 5 6  Groups: php.internals 
Request: Send a blank email to internals+get-33188@lists.php.net to get a copy of this message
Yes, and in even larger scale applications it can become even more useful. I have a web framework I'm working on, it's about 9,500 lines of code now with hundreds of functions/classes. Every function/method has to specify global for my 3 universal variables which contain large arrays of configuration information. With this, I can say "superglobal $mod, $sec, $cfg" in my root include file, and not worry about it again.
class Config { const FOO = "Bar"; } function oink() { if (Config::FOO == 'Bar') { echo "OINK"; } } etc. IMO, you really don't need more superglobals. S

« previous php.internals (#33188) next »