#35470 [Opn->Asn]: Assigning global using variable name from array doesn't function
| From: | sniper@php.net | Date: | Tue, 29 Nov 2005 12:09:50 +0000 |
| Subject: | #35470 [Opn->Asn]: Assigning global using variable name from array doesn't function | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-89383@lists.php.net to get a copy of this message | ||
ID: 35470
Updated by: sniper@php.net
Reported By: prgallier at yahoo dot com
-Status: Open
+Status: Assigned
-Bug Type: *General Issues
+Bug Type: Scripting Engine problem
-Operating System: Linux 2.6
+Operating System: *
-PHP Version: 5.1.1
+PHP Version: 5CVS-2005-11-29 (cvs)
-Assigned To:
+Assigned To: dmitry
New Comment:
Dmitry, can you check this out please.
Previous Comments:
------------------------------------------------------------------------
[2005-11-29 11:33:26] prgallier at yahoo dot com
Oops...the expected and actual result fields are switched.
------------------------------------------------------------------------
[2005-11-29 11:32:20] prgallier at yahoo dot com
Description:
------------
The below code does not store the value "55" in the variable "test" as
it should, and did in PHP 5.0.5. Leaving out the global declaration
allows the output to display properly. I have also had segmentation
faults caused by similar routines, but have been unable to reproduce
this outside of the full program.
Reproduce code:
---------------
$x = array("test", "55");
global ${$x[0]};
${$x[0]} = $x[1];
echo "Test: $test<br>\n";;
Expected result:
----------------
Displays:
Test:
Actual result:
--------------
Should display:
Test: 55
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=35470&edit=1