note 57502 added to language.variables.scope
| From: | Victor at KrishnaDesign dot com | Date: | Thu, 06 Oct 2005 02:06:34 +0000 |
| Subject: | note 57502 added to language.variables.scope | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-96466@lists.php.net to get a copy of this message | ||
I wonder if the PHP designers could make it possible to apply an array of variable names to the
GLOBAL keyword without using a loop. For example:
function global_in_here() {
$names=array("var1","var2","var3");
global array_to_variable_list($names); # what function would be used here to convert the array to
a variable list?
}
rather than:
function global_in_here() {
$names=array("var1","var2","var3");
foreach($names AS $name) global $$name;
}
Victor Epand, Owner
Krishna Design
----
Manual Page -- http://www.php.net/manual/en/language.variables.scope.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+57502
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+57502&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+57502&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+57502&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+57502&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+57502&report=yes&reason=non-english
Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+57502&report=yes&reason=already+in+docs
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+57502&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+57502&report=yes
Search -- http://master.php.net/manage/user-notes.php