ID:               24598
 Updated by:       [EMAIL PROTECTED]
 Reported By:      copraonu at hotmail dot com
-Status:           Open
+Status:           Bogus
 Bug Type:         Variables related
 Operating System: Win32
 PHP Version:      4.3.2
 New Comment:

RTFM: http://www.php.net/variables.variable

(you can't use variable variables with superglobals..)



Previous Comments:
------------------------------------------------------------------------

[2003-07-10 18:29:47] copraonu at hotmail dot com

Description:
------------
I needed to get a variable's or array's value when i had it's name
stored in another variable. To get it, i used $$var_name; it all
functioned as expected until it came across with $GLOBALS


Reproduce code:
---------------
//doesn't work, gets nothing:
$var = "GLOBALS";
$var = $$var;
print_r($var);

//does work: prints $GLOBALS
gettype($GLOBALS);
$var = "GLOBALS";
$var = $$var;
print_r($var);


Expected result:
----------------
i expected output exactly like print_r($GLOBALS)'s

Actual result:
--------------
but got nothing.
I managed to get wanted result when i added
  gettype($GLOBALS);
before the code;


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=24598&edit=1

Reply via email to