Re: user-defined superglobals?

From: Date: Sat, 23 Aug 2003 18:14:33 +0000
Subject: Re: user-defined superglobals?
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-160519@lists.php.net to get a copy of this message
Hi Ray Hunter, you wrote:
you can define your own superglobals by defining the vars first then accessing them thru the $GLOBALS var. example: <?php // file1.php $var1 = "test1\n"; $var2 = "test2\n"; ?> <?php // file2.php include( 'file1.php' ); function test() { echo $GLOBALS['var1']; echo $GLOBALS['var2']; echo "Test\n" } test(); ?> That should get you started with globals. Well, this is clear, (I'm only new in the list - not in PHP ;-) )
but I want it in a better/shorter way for the "master var" of a big project! Is there a way to request such a feature and where? I think this would be nice for application frameworks!? Maybe also for PEAR... Regards, Matthias
-- BigDog On Sat, 2003-08-23 at 11:45, Matthias Nothhaft wrote:
Hi List, is there a way (mybe in php5?) to define/declare a global var as a superglobal, so that I can use this var like the known superglobals ($_GET, $_SESSION, etc.) ??? If not, is there a list for "feature requests"? Regards, Matthias


« previous php.general (#160519) next »