From: prgallier at yahoo dot com
Operating system: Linux 2.6
PHP version: 5.1.1
PHP Bug Type: *General Issues
Bug description: Assigning global using variable name from array doesn't
function
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 bug report at http://bugs.php.net/?id=35470&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=35470&r=trysnapshot4
Try a CVS snapshot (php5.0):
http://bugs.php.net/fix.php?id=35470&r=trysnapshot50
Try a CVS snapshot (php5.1):
http://bugs.php.net/fix.php?id=35470&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=35470&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=35470&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=35470&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=35470&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=35470&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=35470&r=support
Expected behavior: http://bugs.php.net/fix.php?id=35470&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=35470&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=35470&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=35470&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=35470&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=35470&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=35470&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=35470&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=35470&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=35470&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=35470&r=mysqlcfg