note 39208 added to language.variables.scope
| From: | icokan at abv dot bg | Date: | Tue, 20 Jan 2004 20:40:27 +0000 |
| Subject: | note 39208 added to language.variables.scope | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-63899@lists.php.net to get a copy of this message | ||
So as I see it - If I have to count on many variables, defined for instance in a config.inc.php
file, that's included in another inlude file - lets say functions.inc.php - I have but three
alternatives for access to them:
1) declare all the needed varables with the global statement in config.inc.php - gthat means I have
to enumerate them all, which is inefficient;
2)declare the vars as global in the functions.inc.php, which means to enumerate them
<=>inefficient;
3)include the config.inc.php in each function in the functions.inc.php - which is n times more
inefficient;
Am I right and is there a shortcut way through this issue?
macca
----
Manual Page -- http://www.php.net/manual/en/language.variables.scope.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+39208
Delete -- http://master.php.net/manage/user-notes.php?action=delete+39208&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+39208&report=yes
Search -- http://master.php.net/manage/user-notes.php