ParseError thrown

syntax error, unexpected 'if' (T_IF), expecting ';' or ','