Question: I am sorry for posting a pretty redundant question. I was wondering if it was really necessary to use `else {}` if the code just stops or returns a value. In theory, is it really necessary to put `else{}` in these scenarios?

```
function check() {
    if($something == "something") {
        exit;
    }
    echo "hello";
}

```

Or

```
function check() {
    if($something == "something") {
        return true;
    }
    echo "hello";
}

```

The reason I posted this was because I saw some "professional" code which I guess they thought it looked "good."

Answer: 
Syntactically, it's perfectly fine. 

It's also a very common pattern to use, and IMHO, makes code more readable.

For the sake of code clarity/clean coding, if you're returning a boolean you should return a boolean even if the if() doesn't match. 

```
function check() {
    if($something == "something") {
        return true;
    }
    return false;
}

```
There's no hard rule. The question of whether the else clause is used is probably dictated by indentation. If you want the code in the two blocks to line up then you put it in. If you don't then leave it out.