#35470 [Opn]: Assigning global using variable name from array doesn't function

From: Date: Tue, 29 Nov 2005 10:33:27 +0000
Subject: #35470 [Opn]: Assigning global using variable name from array doesn't function
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-89374@lists.php.net to get a copy of this message
ID: 35470 User updated by: prgallier at yahoo dot com Reported By: prgallier at yahoo dot com Status: Open Bug Type: *General Issues Operating System: Linux 2.6 PHP Version: 5.1.1 New Comment: Oops...the expected and actual result fields are switched. Previous Comments: ------------------------------------------------------------------------ [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

« previous php.bugs (#89374) next »