ID: 30179 Updated by: [EMAIL PROTECTED] Reported By: oliver at teqneers dot de -Status: Open +Status: Bogus Bug Type: Arrays related Operating System: Suse 9.0 PHP Version: 4.3.8 New Comment:
Works fine here with 4.3.6, 4.3.8, 4.3.9-dev, 5.0.1 and 5.1.0-dev. Previous Comments: ------------------------------------------------------------------------ [2004-09-21 15:50:47] oliver at teqneers dot de Description: ------------ When I copy an array with a normal "=" the copy is not a real copy, but a reference to it. This only seems to happen to cascaded arrays. When an entry of the original array is unset, the copied entry will be unset as well. Reproduce code: --------------- $arr = array( 'in' => array(1,2,3) ); $copy = $arr; print_r($copy); unset( $arr['in'][1] ); print_r($copy); Expected result: ---------------- Array ( [in] => Array ( [0] => 1 [1] => 2 [2] => 3 ) ) Array ( [in] => Array ( [0] => 1 [1] => 2 [2] => 3 ) ) Actual result: -------------- Array ( [in] => Array ( [0] => 1 [1] => 2 [2] => 3 ) ) Array ( [in] => Array ( [0] => 1 [2] => 3 ) ) ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=30179&edit=1