On Thursday 24 April 2008 14:39:51 Matthew Weier O'Phinney wrote:
> -- Greg Donald <[EMAIL PROTECTED]> wrote
>
> (on Wednesday, 23 April 2008, 04:04 PM -0500):
> > What is gained by using Zend_Registry?  Seems to me I could more
> > easily use the existing PHP $GLOBALS or even $GLOBALS['registry'] if I
> > wanted/needed a namespace.
> >
> >
> > Zend_Registry::set('index', $value);
> >
> > versus
> >
> > $GLOBALS['index'] = $value;
>
> Globals are a really bad idea in almost every case, and they lead to
> some really hairy problems with scoping, determining how and when a
> variable is set, and much more. Do some googling for 'php globals
> problems', and you'll start to get the idea. Try wrapping existing code
> that relies on globals in an MVC framework some time, and you'll start
> to see the issues quickly and noisily.
>
> A Registry is a design pattern that is used to solve the problems of
> globals in a more maintainable and predictable way.
>
> That said, you're free to use $GLOBALS instead of Zend_Registry if you
> still fail to see the point or simply prefer $GLOBALS.

Hello There,

I strongly against your arguments. 

Using globals with namespace does not create any problems. Searcing google 
"php globals problems" produces nothing.

I strongly believe "using globals in php creates problems" is a MYTH. This 
myth creted by programmers  who has strong c and c++ backgrounds.

Large and popular projects like phpAdodb and Typo3 (as far as  I know) uses 
GLOBALS effecively and problem free.

I use GLOBALS for
Language key pairs
Static Config variables
(Db, memcache, etc) resource pointers

I was much faster and pratic than any oo way..

Regards

Sancar

Reply via email to