It often happens to me to handle data that can be either an array or a null variable and to feed some foreach with these data.
foreach
$values = get_val
Exceptional case for this notice occurs if you set array to null inside foreach loop
if (is_array($values)) { foreach ($values as $value) { $values = null;//WARNING!!! } }