From Changelog :
http://php.net/ChangeLog-4.php
Version 4.0.2 29-Aug-2000
Fixed problem with nested foreach()'s. (Andi, Zend Engine)
Just tested the below example code with 4.0.1 and 4.0.3 and above changed
fixed it.
regards,
philip
On Thu, 12 Apr 2001, Tim Ward wrote:
> not for
not for the same array it can't, the pointer in the first foreach is moved
by the second one
try:
$array = array("a", "b", "c");
foreach($array as $val1)
{ foreach($array as $val2) echo "$val1:$val2";
}
it gives
a:a
a:b
a:c
then stops, the manual says that the foreach creates it's own poi
2 matches
Mail list logo