Assuming you are coding in PHP: If $new_var is assigned before the function begins, you can tell the function to use the the "global" version of $new_var rather than creating a local copy using the global operator.
PHP Code:
function example ($input_var) {
global $new_var;
if ($input_var == option1) {
$new_var = new_desired_output1;
}
else {
$new_var = new_desired_output2;
}
}
This may be preferable to pass by reference as you do not need to add the parameter to existing functions, and it is simpler to implement when you are dealing with multiple global variables, although both methods should have similar overhead.