Re: Get name of passed variable in a function
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.php archive

Re: Get name of passed variable in a function

From: Andy Hassall <andy@andyh.co.uk>
Date: Mon Oct 03 2005 - 22:25:36 CEST

On Tue, 04 Oct 2005 09:14:21 +1300, Adam <anon@nowhere.com> wrote:

>function debug($str, $strname) {
>
>debug($foo, "foo");
>
>I'm having to pass two values - the value of the variable AND it's
>name. Is there a way of extracting the NAME of the variable ("foo" in
>this case) without having to pass it?

 In short, no.

-- 
Andy Hassall :: andy@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
Received on Tue Oct 18 02:31:03 2005