//...some_code... function error($one, $two){ $view->set($one, $locale[$two]); $err = true; } if($result1) error('good', '1');