note 57502 rejected from language.variables.scope by betz

From: Date: Thu, 06 Oct 2005 06:43:55 +0000
Subject: note 57502 rejected from language.variables.scope by betz
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-96478@lists.php.net to get a copy of this message
Note Submitter: Victor at KrishnaDesign dot com ---- 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

« previous php.notes (#96478) next »