Mantis - Quercus
Viewing Issue Advanced Details
3082 minor always 11-19-08 11:19 02-10-09 10:03
ferg  
nam  
normal  
closed 3.2.1  
fixed  
none    
none 4.0.0  
0003082: parameter/reference issue with quercus
(rep by junphine) http://forum.caucho.com/?q=node/167 [^]

I test this code in Quercus:

echo '';

function do_d(&$d)
{
$d[67]='dddddddddddddd!';
}

$obj=new stdClass();

$brooms=array(
66=>"sweep",
67=>"clean good",
);

$obj->data=array();
$obj->data['tree']=$brooms;

var_dump($obj->data);

do_d($obj->data['tree']); //$obj->data['tree'] will by change to reference.

var_dump($obj->data);
$B=$obj->data;
$B['tree']=array("be changed!"); //so change $B['tree'] will also change $obj->data['tree'].

var_dump($obj->data);

echo '';

it will display:

array(1) {
["tree"]=>
array(2) {
[66]=>
binary(5) "sweep"
[67]=>
binary(10) "clean good"
}
}
array(1) {
["tree"]=>
&array(2) {
[66]=>
binary(5) "sweep"
[67]=>
binary(15) "dddddddddddddd!"
}
}
array(1) {
["tree"]=>
&array(1) {
[0]=>
binary(11) "be changed!"
}
}

when run this code in apache,it display:

array(1) {
["tree"]=>
array(2) {
[66]=>
string(5) "sweep"
[67]=>
string(10) "clean good"
}
}
array(1) {
["tree"]=>
array(2) {
[66]=>
string(5) "sweep"
[67]=>
string(15) "dddddddddddddd!"
}
}
array(1) {
["tree"]=>
array(2) {
[66]=>
string(5) "sweep"
[67]=>
string(15) "dddddddddddddd!"
}
}

I think this is a big different between Quercus and naivie PHP!

Notes
(0003820)
nam   
02-10-09 10:03   
php/04b1