I would do as my example here, so that would be number 2 :)
I try to follow this logic: Always filter off exception cases first, then do the intended.
So a full method would be
public function setData()
if (! $data)
return;
set_option('name', 'programming');
set_option('age', '60');
set_option('creater', 'Ada');
}
I generally try to avoid nested if-statements or long ones for that matter.