(PHP)
for example, i have functions,which execute heavy queries and return TRUE
or FALSE
.
is there any performance difference:
if ( cond1() && cond2() && cond3() && cond4())
or
if (cond1()){
if (cond2()){
}
}
because, in the last case, if cond1()
is false, then it doesnt execute the other conditions.. is same for the first example?