My question is basically is .. What is good practice for making a function in PHP?  

Eg - if i have two options upvote and downvote.   

So one choice is making 2 seperate functions for upvote and downvote like -

```
function upvote($id,$user){
    //The upvote code goes here..
}
function downvote($id,$user){
    //The downvote code goes here..
}

```

another choice is combining the two functions and make them one using if-else   

eg :

```
function vote($id,$user,$vote){
    if( $vote == 'upvote' ){
        //The upvote code goes here..
    }
    else {
       // the downvote code goes here..
    }
}

```

So i wanted to know which of the two methods is a good practice and which can be more speedy ( Performance wise ).  

PS - I am including my function file on top of Every page.