From: reimer at webhostingtech dot de Operating system: PHP version: Irrelevant PHP Bug Type: Feature/Change Request Bug description: Why isn't there a $_GLOBAL
Description: ------------ This is not bug, but a feature request. Since the release 4.1 we all use $_POST, $_GET, $_SESSION etc. for our scripting. I was just wondering why we do not use $_GLOBALS to access variables outside the class or function. I think this would fit better than $GLOBALS :) Reproduce code: --------------- <? $_REQUEST["foo"] = "foo"; $foo = "foo"; function foo() { echo $_REQUEST["foo"]; // Works echo $GLOBALS["foo"]; // Works echo $GLOBALS["foo"]; // Does not work } ?> Expected result: ---------------- Prints foos and an error. -- Edit bug report at http://bugs.php.net/?id=29866&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=29866&r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=29866&r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=29866&r=trysnapshot51 Fixed in CVS: http://bugs.php.net/fix.php?id=29866&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=29866&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=29866&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=29866&r=needscript Try newer version: http://bugs.php.net/fix.php?id=29866&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=29866&r=support Expected behavior: http://bugs.php.net/fix.php?id=29866&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=29866&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=29866&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=29866&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=29866&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=29866&r=dst IIS Stability: http://bugs.php.net/fix.php?id=29866&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=29866&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=29866&r=float