#29866 [Opn->WFx]: Why isn't there a $_GLOBAL

From: Date: Fri, 27 Aug 2004 11:57:09 +0000
Subject: #29866 [Opn->WFx]: Why isn't there a $_GLOBAL
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-65349@lists.php.net to get a copy of this message
ID: 29866 Updated by: derick@php.net Reported By: reimer at webhostingtech dot de -Status: Open +Status: Wont fix Bug Type: Feature/Change Request PHP Version: Irrelevant New Comment: We're not perl ;-) and therefore are not going to create another way of accessing globals while $GLOBALS perfectly does what we need. Previous Comments: ------------------------------------------------------------------------ [2004-08-27 13:55:18] reimer at webhostingtech dot de 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 this bug report at http://bugs.php.net/?id=29866&edit=1

« previous php.bugs (#65349) next »