MFH: Fixed bug #46649 (Setting array element with that same array produces

inconsistent results)
This commit is contained in:
Arnaud Le Blanc 2008-11-23 20:35:16 +00:00
parent 65cfb01eaa
commit a23d168531
2 changed files with 27 additions and 0 deletions

View File

@ -8,6 +8,16 @@ var_dump($a);
$b = array(array());
$b[0][0] = $b;
var_dump($b);
function f() {
$a = array();
$a[0] = $a;
var_dump($a);
$b = array(array());
$b[0][0] = $b;
var_dump($b);
}
f();
?>
--EXPECT--
array(1) {
@ -26,3 +36,19 @@ array(1) {
}
}
}
array(1) {
[0]=>
array(0) {
}
}
array(1) {
[0]=>
array(1) {
[0]=>
array(1) {
[0]=>
array(0) {
}
}
}
}

View File

@ -583,6 +583,7 @@ void zend_do_assign(znode *result, znode *variable, const znode *value TSRMLS_DC
CG(active_op_array)->vars[value->u.var].name,
CG(active_op_array)->vars[value->u.var].name_len, 1);
SET_UNUSED(opline->op2);
opline->op2.u.EA.type = ZEND_FETCH_LOCAL;
value = &opline->result;
}
}