Re: Opinion about the using $GLOBALS directly

From: Date: Wed, 19 Dec 2007 11:08:04 +0000
Subject: Re: Opinion about the using $GLOBALS directly
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-266067@lists.php.net to get a copy of this message
On Wed, 2007-12-19 at 12:13 +0200, Sancar Saran wrote: > Hello list. > > I want know to you opinions about using $GLOBALS directly. > > like > > $GLOBALS['myString'] = 'test'; > $GLOBALS['myArray']['this'] = 'this'; > $GLOBALS['myArray']['that'] = 'that'; > $GLOBALS['myClassObj] = new SomeClass; It can avoid problems sometimes (files included via functions) and it's obvious from reading the code exactly where the variable is being set. Cheers, Rob. -- ........................................................... SwarmBuy.com - http://www.swarmbuy.com Leveraging the buying power of the masses! ...........................................................

« previous php.general (#266067) next »