The other day we had a discussion on #drupal about the speed of various foreach constructs and webchick said I should blog this. First of all, let me give you a crash course on PHP references. Imagine variables values as drawers and names as labels on the drawers. One drawer can have more than one label and that's what we call a reference. So when you write
$a = &$b then PHP slaps a label on the drawer that holds the value of
$a. Now, if you
unset($a) then PHP removes the "a" label from the drawer, however the "b" label is still on it.