Re: Global Variables -- why not have them?

From: Date: Mon, 09 Jul 2001 01:13:30 +0000
Subject: Re: Global Variables -- why not have them?
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-56848@lists.php.net to get a copy of this message
> I dislike the GLOBAL statement in that many of the bugs that get me > scratching my > head are to do with when I have forgotten to use it. Then you're probably using it way too often. Global scope variable are inherently dangerous and cause more problems than they're worth. I've been in this business well nigh 30 years now and have had more problems with globals than I can shake a stick at. Passing parameters ain't a bad thing, you know, even when what you're passing is a variable declared in global scope (like variables set via post or get). Global is inelegant by definition ... I worked in Fortran 77 for 10 of those years; we were really careful with common blocks and included them only where absolutely necessary. Passing array blocks was in almost all cases a "better thing" and was not any slower. Mark C.

« previous php.general (#56848) next »