note 7995 added to Variable scope
| From: | niki at littlebull dot com | Date: | Wed, 23 Aug 2000 18:59:07 +0000 |
| Subject: | note 7995 added to Variable scope | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-3030@lists.php.net to get a copy of this message | ||
Dear Anonymous: Well, sure. If I try to take advantage of a powerful programming concept, and break
my code because I forgot something essential, well of COURSE that's my fault, not the
langauge's. Should go without saying. Hence with global variables: they can be very useful when
used right, and I appreciate a language that lets me do useful things. The human possibility of
forgetting that a variable is global is not an effective indictment of the global variable concept!
See, the price of a langauge that lets you do useful things has always been a langauge that lets you
do bonehead screwups too, but hey, that's just another reason why "C++ For Dummies"
should never have been written.
It would be nice if PHP allowed a global GLOBAL. Instead of having to say "GLOBAL $a, $b"
at the beginning of every function, I'd like to introduce my variable in the global scope as
"GLOBAL $var" and then have it visible from all functions and sub-scopes.
http://www.php.net/manual/language.variables.scope.php