All pastes #35120 Raw Edit

Miscellany

public text v1 · immutable
#35120 ·published 2005-12-29 02:44 UTC
rendered paste body
function &getEach(&$a)
{
	if(($elem = current($a)) !== FALSE)
	{
		$k = key($a);
		next($a);
		return $a[$k];
	}
	return false;
} 

/*
this is a key function to my entire program....
For obvious reasons, when the function returns false, the Notice goes up: Only variable references should be returned by reference 

What could I do to change this while maintaining the usefulness of the function?
*/