Re: Opinion about the using $GLOBALS directly

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Sancar Saran schreef:
> 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;

there is no real difference between 'global $foo' and $GLOBALS['foo'],
and the second is probably more maintainance friendly (as Rob pionted out)

that said, avoid globals like the plague - sometimes you may come up with
a situation where using a global is really necessary - such situations should
be the exception rather than the rule, often if your thinking of using a
global there is another way of doing it. jmho

> 
> Regards
> 
> Sancar
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux