I got a question about PHP/in general performance difference in the order of if / elseif / else statements. It makes sense to run a if / elseif / else statements in order of the most often true statement at first for less checks, to improve performance.
Now my question is, what about simple if/else statements without elseif? Does it make a difference if the statemen if is false and it jumps to the else case which actualy doesnt check anything since its the default? Or is there also an additional time added to the runtime by jumping to the else instead of inside the if statement? And if so how much of a difference does it make?
Edit:
@MonkeyZeus thanks for that term.
Yes that is part of what i mean. But in case of this:
if(x>10) {y = 10}
else {y = 0}
//or
if(x!>10) {y = 0}
else {y = 10}
does it make a difference if it jumps to the else since it checks always one statement? So if lets say case 1 happens more often, i go that way, if case 2 happens more often, i go that way with the code. The result is the same but in one way it jumps 80% of the time in the if case in the other case it jumps 80% in the else case.