ID: 13269
Updated by: yohgaki
Reported By: [EMAIL PROTECTED]
Old Status: Open
Status: Closed
Bug Type: Scripting Engine problem
Operating System: Win98
PHP Version: 4.0.5
New Comment:

It works for me. I guess this is fixed.

Previous Comments:
------------------------------------------------------------------------

[2001-09-12 14:49:47] [EMAIL PROTECTED]

Another way of the references & array problem that shows up while copying arrays:

<?

$aArray = Array();
$aArray["test"] = "Hello World!";

$rRef = &$aArray["test"];

echo $rRef."<br>";

$aArray2 = Array();
$aArray2["test"] = "Hello World 2!";

$aArray = $aArray2;

echo $aArray["test"]."<br>";
echo $rRef;

?>

The last echo should return "Hello World 2!" but it doesnt. 

A workaround is to copy the arrays per key:

<?

while (list($key) = each($aArray2)) {
      $aArray[$key] = $aArray2[$key];
}

?>

then all is ok.

------------------------------------------------------------------------



Edit this bug report at http://bugs.php.net/?id=13269&edit=1


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to