Odi's astoundingly incomplete notes
New entries | CodeWhy PHP References are crap
$iterator =& $queue->iterator(); $list = array(); while ($iterator->hasNext()) { $obj =& $iterator->getNext(); $list[] =& $obj; }Will not do what you expect. It will merely screw up all the objects in
$queue
. $list[]
will then contain n identical references to the last object.
Yes PHP guys, you really make my day.Add comment