so if you use strict equality to compare two separate arrays, you get true if all their keys and values are the same:
$arr1 = array('a', 'b', 'c');
$arr2 = array('a', 'b', 'c');
echo ($arr1 === $arr2) ? "EQUAL\n" : "NOT EQUALj\n"; // outputs 'EQUAL'
Is there any way to discern whether one array is a reference to another array, and not just a separate array with identical keys and values?
function is_ref($a1, $a2) {
// returns TRUE if $a1 =& $a2;
}
$arr1 = array('a', 'b', 'c');
$arr2 = array('a', 'b', 'c');
$ref =& $arr1;
echo (is_ref($arr1, $arr2)) ? "REF\n" : "NOT A REF\n"; // should say NOT A REF
echo (is_ref($arr1, $ref)) ? "REF\n" : "NOT A REF\n"; // should say REF