no, it will generate an error if the variable is not declared as an array.
for example:
PHP Code:
<?
// bad, this will generate an error
// since $myarray as not been declared as an array
foreach($myarray as $each){
// do something
}
// this next one is ok because
// php knows that $myarray is an array
// now it will skip the foreach and not generate an error
$myarray = array();
foreach($myarray as $each){
// do something
}
?>