From: graced at monroe dot wednet dot edu Operating system: Linux 2.4.21 (RHAS3) PHP version: 5.0.4 PHP Bug Type: Feature/Change Request Bug description: User-defined superglobals
Description: ------------ This is related to bug #18060, which is marked as "Won't fix", but I'd like to add some input to it and can't. It would be nice to have a programming construct that turns a regular variable into a superglobal along the same lines as $_GET/$_REQUEST/$_POST/$_SERVER/etc. I have a large project that has a 'configuration' stored in the global $CFG. Having to global this (or type $GLOBALS['CFG']) every time it needs to be checked inside one of a multitude of functions is very time consuming. I'd rather be able to write: superglobal $CFG; just once, since it's much cleaner than having to remember to global it everywhere. If it's the programmer's discretion as to whether a variable is a superglobal (rather than all variables being 'superglobal' like in some other languages) it should avoid the "nasty global variable side-effects" that other languages are prone to -- Edit bug report at http://bugs.php.net/?id=33409&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=33409&r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=33409&r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=33409&r=trysnapshot51 Fixed in CVS: http://bugs.php.net/fix.php?id=33409&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=33409&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=33409&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=33409&r=needscript Try newer version: http://bugs.php.net/fix.php?id=33409&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=33409&r=support Expected behavior: http://bugs.php.net/fix.php?id=33409&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=33409&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=33409&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=33409&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=33409&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=33409&r=dst IIS Stability: http://bugs.php.net/fix.php?id=33409&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=33409&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=33409&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=33409&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=33409&r=mysqlcfg