ID: 22518 User updated by: rabus at users dot sourceforge dot net Reported By: rabus at users dot sourceforge dot net Status: Bogus Bug Type: Scripting Engine problem Operating System: Windows NT PHP Version: 5CVS-2003-03-03 (dev) New Comment:
I am sorry for this bogus report. Since German is my mother tounge, I read the German edition of your manual. Unfortunately, the note you mentioned is missing there. >From now on, I'll read the English one, only, since the German one appears a little out-of-date to me. Previous Comments: ------------------------------------------------------------------------ [2003-03-03 20:14:11] [EMAIL PROTECTED] RTFM: http://www.php.net/manual/en/language.variables.predefined.php#language.variables.predefined "Variable variables: Superglobals cannot be used as variable variables." ------------------------------------------------------------------------ [2003-03-03 09:22:00] daniel dot gorski at develnet dot org Similar malfunction here: <?php error_reporting(E_ALL); print_r($_SERVER); print_r($_ENV); ?> PHP Notice: Undefined variable: _SERVER in /var/webservers/cowiki/htdocs/test.php on line 6 PHP Notice: Undefined variable: _ENV in /var/webservers/cowiki/htdocs/test.php on line 7 Todays CVS, build as CGI on RH6.2 regards dtg ------------------------------------------------------------------------ [2003-03-03 08:06:46] rabus at users dot sourceforge dot net Please try the following script: <?php function foo() { echo $_SERVER; } foo(); ?> This script returns "Array". This is the expected behavior. Now, try this one: <?php function foo() { $bar = '_SERVER'; echo $$bar; } foo(); ?> This time, an error is returned: Notice: Undefined variable: _SERVER on line 4 This is nonsense, of course: As we see in the example above, the variable should be defined! ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=22518&edit=1
