note 100154 added to language.variables.scope

From: Date: Tue, 28 Sep 2010 16:36:07 +0000
Subject: note 100154 added to language.variables.scope
Groups: php.notes 
Request: Send a blank email to php-notes+get-172777@lists.php.net to get a copy of this message
Why would you want to use globals everywhere? The only reason I can think of, is that you are working on someone else's script. Anyway, this is a very dangerous practice, because if someone else uses your global variable for something, your program probably will not behave very well. Another problem is, that it is hard to debug. Where is the variable changed? Never use globals, if there are other possibilities. (Within your time of frame of ofcourse) ---- Server IP: 213.249.64.162 Probable Submitter: 195.241.100.248 ---- Manual Page -- http://www.php.net/manual/en/language.variables.scope.php Edit -- https://master.php.net/note/edit/100154 Del: integrated -- https://master.php.net/note/delete/100154/integrated Del: useless -- https://master.php.net/note/delete/100154/useless Del: bad code -- https://master.php.net/note/delete/100154/bad+code Del: spam -- https://master.php.net/note/delete/100154/spam Del: non-english -- https://master.php.net/note/delete/100154/non-english Del: in docs -- https://master.php.net/note/delete/100154/in+docs Del: other reasons-- https://master.php.net/note/delete/100154 Reject -- https://master.php.net/note/reject/100154 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#172777) next »