In PHP, does elseif need a final else statement?

Viewed 5710

Is it ok to leave out the final else statement in an elseif block in PHP. Is this code OK

if ( condition ):
   // code
elseif ( othercondition ):
   // more code
endif;

or should it have else at the end ?

if ( condition ):
   // code
elseif ( othercondition ):
   // more code
else
   // more code
endif;

I'm sure it must be but I cant get it confirmed anywhere. Edit - I've tried it and it works but I just want to be sure.

2 Answers
Related