> Is it just as quick to do:
>
> if($r == 0) {
> } else if($r != 0) {
> }
>
> than to do:
>
> if($r == 0) {
> } else {
> }
>
> The reason I like the former method is because, in a large IF-ELSE
> block, it's clear what belongs to what IF and what's going on. But does
> this make it lag? And, if so, is it really all that noticeable?

I don't know which is actually quicker, but I would guess that the first
case would take longer since it PHP has to evaluate "$r != 0" instead of
just doing whatever is in the "else { ... }" clause.

If you want clarity, why not:

if($r == 0) {
 ...
} else { // $r != 0
}

that gets you the clarity, but keeps PHP from having to evaluate it.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to