Re: Getting name of referenced variable into string

From: Date: Sat, 20 Jul 2002 06:50:40 +0000
Subject: Re: Getting name of referenced variable into string
Groups: php.general 
Request: Send a blank email to php-general+get-108637@lists.php.net to get a copy of this message
>Is there a way to get and store the name of a referenced variable into >another variable? Example... > >$varname = "blah"; >checkit($varname); > >function checkit(&$name) { > ...code... >} > >In the function above, I'd like to find out the name of the referenced >variable (pointed to by $name) which should equal "varname" so I can store >this string in another variable (i.e., $thename = "varname"). > >Is there a way to do this in PHP?? No. And, really, there shouldn't be... The whole point of functions is to isolate the kinds of bugs you're going to create by doing whatever it is you are trying to do... :-) What is that you're trying to do anyway? I suspect you'll get a much better solution by stepping back and asking about a general way of doing whatever it is. -- Like Music? http://l-i-e.com/artists.htm

« previous php.general (#108637) next »