ID:               34518
 Updated by:       [EMAIL PROTECTED]
 Reported By:      genome at digitaljunkies dot ca
-Status:           Assigned
+Status:           Closed
 Bug Type:         Scripting Engine problem
 Operating System: *
 PHP Version:      5CVS-2005-09-15
 Assigned To:      dmitry
 New Comment:

Fixed in CVS HEAD and PHP_5_1.


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

[2005-09-16 10:09:19] [EMAIL PROTECTED]

Dmitry, I think it was you who fixed the problem in bug #27381, can you
check this one out?


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

[2005-09-16 00:02:30] genome at digitaljunkies dot ca

Description:
------------
Altering a subindex of a copy of an array alters the original array as
well.  Similar to bug#27381.  Altering a root index does not exhibit
this behaviour.

Reproduce code:
---------------
<?php

$arr = array(1,2,3);
$arr["foo"] = array(4,5,6);
$copy = $arr;

unset($copy["foo"][0]);
print_r($arr);

?>

Expected result:
----------------
Array
(
    [0] => 1
    [1] => 2
    [2] => 3
    [foo] => Array
        (
            [0] => 4
            [1] => 5
            [2] => 6
        )

)


Actual result:
--------------
Array
(
    [0] => 1
    [1] => 2
    [2] => 3
    [foo] => Array
        (
            [1] => 5
            [2] => 6
        )

)


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


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

Reply via email to