ParseError thrown

syntax error, unexpected 'else' (T_ELSE)