1// PHP will copy the array by default.
2$a = array(1,2);
3
4$b = $a; // $b will be a different array
5
6$c = &$a; // $c and $a will be the same array (same reference)
1$arr1 = ['a'=>1, 'b'=>2, 'c'=>3];
2$arr2 = $arr1;
3
4unset($arr2['a'];
5print_r($arr1);
6//['b'=>2, 'c'=>3]
7// ------- OR -------
8$arr2 = clone $arr1;
9
10unset($arr2['a'];
11print_r($arr1);
12//['a'=>1, 'b'=>2, 'c'=>3]