| 
	
 | 
 Posted by Chung Leong on 01/12/06 09:48 
André Hänsel wrote: 
> produces an infinite loop. Probably since the result of array_key doesn't 
> support an array pointer or so, I don't know how this is internally 
> implemented. 
 
I should add that there is a real bug in PHP 4.4.1 that causes infinite 
loop, shown in the following example. 
 
<? 
 
$array = array(1, 2, 3); 
 
function loop(&$array) { 
	while(($key = key($array)) !== null) { 
		echo "Hello $key<br>"; 
		next($array); 
	} 
} 
 
loop($array); 
 
?>
 
  
Navigation:
[Reply to this message] 
 |