I am trying to run following code:
$a = array('aa');
function my_func (& $m) {
return $m;
}
$c = & my_func($a);
$c[] = 'bb';
var_dump($a);
echo '--------';
var_dump($c);
My expectation were that $a and $c would have same reference. But the result is different.
Result i got was:
array(1) { [0]=> string(2) "aa" } --------array(2) { [0]=> string(2) "aa" [1]=> string(2) "bb" }
What is wrong in above piece of code?