[php] cleanest way to skip a foreach if array is empty