Are elseif and else if completely synonymous, or is there a difference?
Does Zend have an accepted “standard” on which one to use?
While I personally dislike seeing elseif in the code, I just need to know if they’re synonymous and the PHP manual isn’t the easiest to search.
From the PHP manual:
Essentially, they will behave the same, but
else ifis technically equivalent to a nested structure like so:The manual also notes:
Which means that in the normal control structure form (ie. using braces):
either
elseiforelse ifcan be used. However, if you use the alternate syntax, you must useelseif: