This caught me out:
unset($tarray)
unset($undefined)
$tarray["one"] = 1;
$undefined =& $tarray["two"];
while (list($key, $value) = each($tarray)) {
echo $key . "|" . $value . "<br>";
}
That code will generate this output:
one|1
two|
So you can see that the line
$undefined =& $tarray["two"];
creates a key "two" with an unset value in the array. This caught me out because I had a routine that checked to see if a key/value was in an array like this:
$tmp =& $tarray[$key];
if (! empty($tmp)) { do stuff }
This test inserted the orphaned key into the array if it didn't already exist and generated an error miles away in the code, which puzzled me since I thought I had cleverly protected against improper values being added to the array.
I think it's a bug, personally.