Is if($var){ ... }
faster than if($var): ... endif
?
Which one do you use?
Is if($var){ ... }
faster than if($var): ... endif
?
Which one do you use?
I'm sure the difference is negligible, if there is any. If the difference is important to you, you should probably use a faster (likely compiled) language.
You would do better optimizing more intensive things, like databases first (and writing clean code, as @Tim stated).
I think both are the same. Personally I prefer if($var: ... endif;
. php is a template language and that syntax leads to extremely well toward it. I actually put all variables in <? ... ?>
tags to keep it all clean and concise.