Mantis - Quercus
Viewing Issue Advanced Details
1155 major always 05-26-06 22:11 05-01-06 08:33
koreth  
ferg  
normal  
closed 3.0.20  
fixed  
none    
none 3.0.20  
0001155: Multidimensional array copies contain references to original array
PHP:

<?php
$a1['x']['a'] = 1;
$a2 = $a1;
unset($a1['x']['a']);
print $a2['x']['a'];
?>

On Zend PHP, this prints "1". On Quercus, it prints nothing -- unsetting the second-dimension array element in $a1 also modifies $a2.

This does not happen on the first dimension of an array, only on the second and greater dimensions.
060526 snapshot

Notes
(0001243)
koreth   
05-26-06 22:25   
A "fix" (which I assume is not optimal for performance reasons) is to comment out the ArrayValueImpl(ArrayValueImpl) constructor so the generic ArrayValueImpl(ArrayValue) one is used instead. That makes the test pass and makes the problems this bug was causing in my real code go away.
(0001245)
ferg   
05-01-06 08:33   
php/044x, php/344x