Bug in Foreach.....???

From: Rob (reply__at_news_group.please)
Date: 12/23/04


Date: Thu, 23 Dec 2004 16:02:18 GMT

Hello all,

My provider upgraded from php version 4.3.x to 4.3.10. And I found out the
foreach construct is working different
When using as follows:

foreach($any_array as $item){
    print_r($item)
}

$item is an array!!! The output is as follows:

array (
  [0]=>'the value of the current array item'
  [1]=>'the index of the current array item'
)

When using

foreach($any_array as $index->$item){
    print_r($item);
}
it is working as expected printing the value of the array entry.

Is this a bug?
If not did I miss something?

See also the last note in
http://www.php.net/manual/nl/control-structures.foreach.php)

ROB