#23675 [Opn->Bgs]: Autoglobals are not accessible through a variable variable
| From: | derick@php.net | Date: | Sun, 18 May 2003 08:02:08 +0000 |
| Subject: | #23675 [Opn->Bgs]: Autoglobals are not accessible through a variable variable | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-39864@lists.php.net to get a copy of this message | ||
ID: 23675
Updated by: derick@php.net
Reported By: vma1 at abv dot bg
-Status: Open
+Status: Bogus
Bug Type: Variables related
Operating System: Slackware 9
PHP Version: 5CVS-2003-05-17 (dev)
New Comment:
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
Read from
"http://www.php.net/manual/en/language.variables.predefined.php#language.variables.predefined"
(found by typing "superglobals" in our manual search box):
Variable variables: Superglobals cannot be used as variable
variables.
Previous Comments:
------------------------------------------------------------------------
[2003-05-17 19:45:01] vma1 at abv dot bg
<?
abc123 ();
function abc123 ()
{
$name = "_SERVER";
printf ("%s<br>", ${$name}["SERVER_NAME"]);
}
?>
The _SERVER autoglobal array is not accessible through a variable
variable. The above script gives the following error:
Notice: Undefined variable: _SERVER in
/usr/local/apache/site/htdocs/zzz.php on line 7
When the _SERVER array is accessed directly (not through a variable
variable) everything works correctly.
Here is the configure line:
./configure --with-pgsql --with-apache=../apache-1.3
--enable-track-vars --with-pfpro=/usr/local/src/payflowpro/linux
--with-imap=/usr/local/src/imap-2003.DEV.SNAP-0304071905
--with-imap-ssl=/usr/include/openssl --without-pear
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=23675&edit=1