#34768 [Opn->WFx]: Global keyword

From: Date: Fri, 07 Oct 2005 07:35:09 +0000
Subject: #34768 [Opn->WFx]: Global keyword
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-86172@lists.php.net to get a copy of this message
ID: 34768 Updated by: derick@php.net Reported By: victorepand at hotmail dot com -Status: Open +Status: Wont fix Bug Type: Feature/Change Request Operating System: Linus PHP Version: 4.4.0 New Comment: As it is bad practise to use globals in the first place, we will not add this feature. Previous Comments: ------------------------------------------------------------------------ [2005-10-07 01:13:28] victorepand at hotmail dot com Description: ------------ 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; } Thanks, Victor Epand, Owner Krishna Design ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=34768&edit=1

« previous php.bugs (#86172) next »