function whatever(Array $array) { foreach ($array as $key => $value) { if ($something) { return true; } } return false; }
Is there any reason -- style, legibility, whatever -- not to do the above? Or should you do something like function whatever(Array $array) { $return = false; foreach ($array as $key => $value) { if ($something) { $return = true; break; } } return $return; } Thanks. -- David Mintz http://davidmintz.org/ Fight for social equality: http://socialequality.com/
_______________________________________________ New York PHP User Group Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk http://www.nyphp.org/show-participation