From:             andrea dot busia at axis-sv dot it
Operating system: Win / Linux
PHP version:      5.0.1
PHP Bug Type:     Scripting Engine problem
Bug description:  $a=$GLOBALS works as $a=&$GLOBALS

Description:
------------
In this script seems that the $GLOBALS value is changed by the unset
statement but I want to modify $ar, $GLOBALS must remain the same as
before.


Reproduce code:
---------------
<?
$xml=array("aaa", "bbb", "ccc");
foo();

function foo() {
        var_dump($GLOBALS["xml"]);
        $ar=$GLOBALS;
        unset($ar['xml']);
        var_dump($GLOBALS["xml"]);
}
?>

Expected result:
----------------
array(3) {
  [0]=>
  string(3) "aaa"
  [1]=>
  string(3) "bbb"
  [2]=>
  string(3) "ccc"
}
array(3) {
  [0]=>
  string(3) "aaa"
  [1]=>
  string(3) "bbb"
  [2]=>
  string(3) "ccc"
}


Actual result:
--------------
array(3) {
  [0]=>
  string(3) "aaa"
  [1]=>
  string(3) "bbb"
  [2]=>
  string(3) "ccc"
}
NULL


-- 
Edit bug report at http://bugs.php.net/?id=29702&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=29702&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=29702&r=trysnapshot5
Fixed in CVS:               http://bugs.php.net/fix.php?id=29702&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=29702&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=29702&r=needtrace
Need Reproduce Script:      http://bugs.php.net/fix.php?id=29702&r=needscript
Try newer version:          http://bugs.php.net/fix.php?id=29702&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=29702&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=29702&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=29702&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=29702&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=29702&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=29702&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=29702&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=29702&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=29702&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=29702&r=float

Reply via email to