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
Personally I find this to be the most clean - not sure if it's the most efficient, mind!
if (is_array($values) || is_object($values)) { foreach ($values as $value) { ... } }
The reason for my preference is it doesn't allocate an empty array when you've got nothing to begin with anyway.