#31260 [Opn->Bgs]: Not work constraction of "variable of variable"
| From: | tony2001@php.net | Date: | Thu, 23 Dec 2004 00:19:03 +0000 |
| Subject: | #31260 [Opn->Bgs]: Not work constraction of "variable of variable" | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-70941@lists.php.net to get a copy of this message | ||
ID: 31260
Updated by: tony2001@php.net
Reported By: sverel at mail dot ru
-Status: Open
+Status: Bogus
Bug Type: Scripting Engine problem
Operating System: Windows XP build 2600 (SP2)
PHP Version: 4.3.8
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
"Variable variables: Superglobals cannot be used as variable variables
inside functions or class methods." (c)
http://www.php.net/manual/en/language.variables.predefined.php
Previous Comments:
------------------------------------------------------------------------
[2004-12-22 23:34:54] sverel at mail dot ru
Description:
------------
------
Reproduce code:
---------------
Not working:
<?php
$G= 'GLOBALS';
print "${$G}".'<HR>';
/* printing "Notice: Undefined variable: GLOBALS in C:\http\globals.php
on line 22" */
print "${$G}<HR>";
/* printing "Notice: Undefined variable: GLOBALS in C:\http\globals.php
on line 23" */
// print $GLOBALS.'<HR>';
?>
Working:
<?php
$G= 'GLOBALS';
print "${$G}".'<HR>'; // printing "Array"
print "${$G}<HR>"; // printing "Array"
print $GLOBALS.'<HR>';
?>
Expected result:
----------------
Notice: Undefined variable: GLOBALS in C:\http\globals.php on line 23
Actual result:
--------------
Array
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=31260&edit=1