switch($op) { ... case "host_risk": if (isset($params['0'])) { $result = host_risk($params['0']); } else { $result = false; } break; ... }