Assign by reference bug
I came across this seemingly very simple question the other day How to changing value in $array2 without referring $array1? However the more i looked into it the more odd it seemed that this is indeed functioning as intended. After this I started looking into the opcodes that are generated from the output of the following. $array1 = array(2, 10); $x = &$array1[1]; $array2 = $array1; $array2[1] = 22; echo $array1[1]; // Outputs 22 This seems crazy to me since array2 should only be a copy of array1 and anything that happens to one array should not effect the contents of the other. Of course if