James wrote:
if ($a == $b)
{
echo "Variable A is the same as Variable B";
}
No, no, no, no, no. No!
That tests if they have the same value. I know how to do that. I want to test if they are the same variable, if they have the same reference.
Assume it's a function called samevar. Then in this case:
$a = 1;
$b = 2;
echo samevar($a, $b)
would output false but
$a = 1;
$b =& $a;
echo samevar($a, $b)
would output true. See?