ParseError thrown

syntax error, unexpected 'else' (T_ELSE), expecting function (T_FUNCTION)