I've always been curious about this. Between the two code example which is more processor efficient? I understand that various languages may be different and I need to know what the answer is in PHP, but I am also curious about javaScript, CFScript, and ActionScript if the answer would be different.
Thanks
ps:The example may not be exact for a particular language, but I'm sure you will get the point
Example 1:
if(myVar < 1){
return;//returned with nothing
else{
//do something
}
Example 2:
if(myVar < 1){
//left blank
else{
//do something
}
EDIT: Guys, you're right, this would probably be completely unnecessary, I am asking this out of curiosity more than anything. I've been doing web development for more than a decade and It's all pretty much been self taught. I've seen a lot of code using both methods from "trained professionals" and was wondering if this was a personal preference or one group of people knew something the other didn't.
Also these are pseudo code examples.I'm asking about multiple languages where the details would be slightly different and the test is a simple one just to make sure you knew what I was asking about. It should be assumed that these examples would be in a function.