#28832 [NEW]: Operator = doesn't copy $GLOBALS array
| From: | tomas_matousek at hotmail dot com | Date: | Fri, 18 Jun 2004 15:00:41 +0000 |
| Subject: | #28832 [NEW]: Operator = doesn't copy $GLOBALS array | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-61069@lists.php.net to get a copy of this message | ||
From: tomas_matousek at hotmail dot com
Operating system: WinXP
PHP version: 5.0.0RC3
PHP Bug Type: Scripting Engine problem
Bug description: Operator = doesn't copy $GLOBALS array
Description:
------------
When the operator = is used on user created array on RHS this array will
be copied to LHS. But if $GLOBALS variable is used on RHS a copy is not
made. It seems like it behaves as =& when used on $GLOBALS which is IMHO
not correct.
Reproduce code:
---------------
$x = 1;
$a = $GLOBALS;
$a["x"] = 2;
echo $x;
Expected result:
----------------
1
Actual result:
--------------
2
--
Edit bug report at http://bugs.php.net/?id=28832&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=28832&r=trysnapshot4
Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=28832&r=trysnapshot5
Fixed in CVS: http://bugs.php.net/fix.php?id=28832&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=28832&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=28832&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=28832&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=28832&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=28832&r=support
Expected behavior: http://bugs.php.net/fix.php?id=28832&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=28832&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=28832&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=28832&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=28832&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=28832&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=28832&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=28832&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=28832&r=float