note 86406 added to reserved.variables.globals
| From: | Pyornide at osu1 dot php dot net | Date: | Thu, 16 Oct 2008 21:43:17 +0000 |
| Subject: | note 86406 added to reserved.variables.globals | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-145439@lists.php.net to get a copy of this message | ||
I strongly recommend against using globals at all possible. It's a bad programming practice,
and you're better off using references and passing them on construct to use them in the $this
context. If you're worried about parameters, you can simply use an associative array to store
any passed variables to it. Overall, the main idea is to avoid using globals.
http://www.phpit.net/article/using-globals-php/
Is a good article detailing other reasons why using the global scope is a very bad idea.
----
Server IP: 64.71.164.2
Probable Submitter: 68.173.205.18
----
Manual Page -- http://www.php.net/manual/en/reserved.variables.globals.php
Edit -- https://master.php.net/note/edit/86406
Del: integrated -- https://master.php.net/note/delete/86406/integrated
Del: useless -- https://master.php.net/note/delete/86406/useless
Del: bad code -- https://master.php.net/note/delete/86406/bad+code
Del: spam -- https://master.php.net/note/delete/86406/spam
Del: non-english -- https://master.php.net/note/delete/86406/non-english
Del: in docs -- https://master.php.net/note/delete/86406/in+docs
Del: other reasons-- https://master.php.net/note/delete/86406
Reject -- https://master.php.net/note/reject/86406
Search -- https://master.php.net/manage/user-notes.php