in C, references are great. you make a variable, reference it elsewhere, and then use pointers to the reference to change things around....
however, it seems that in php things work slightly differently... you make a variable...
say $GLOBALS['testg'] = Array(1,2,3,4);
then you reference it...
say $gtest =& $GLOBALS['testg'];
works great!
$testg[] = 5;
$gtest[] = 6;
now both $gtest and $testg are
Array ( [0] => 1 [1] => 2 [2] => 3 [3] => 4 [4] => 5 [5] =>6 )
so obviously, $gtest and $testg are the same exact thing. now if this were c, I know that $testg is really Array(1,2,3,4,5,6) and that $gtest is really the location where $testg is located... but it seems to work differently in php since
unset($testg);
print_r($gtest);
echoes
Array ( [0] => 1 [1] => 2 [2] => 3 [3] => 4 [4] => 5 [5] =>6 )
so it seems to me that $testg and $gtest are both actually references for some thing I can't see nor have access to since php doesn't have pointers.
and, yes... I tried print_r($GLOBALS['testg']) after unsetting $testg just in case $testg was actually a reference to $GLOBALS['testg']
so.... how do I unset all references to a variable if I don't actually know all the reference names? I was under the impression that by unsetting one, I'd unset them all....