ParseError thrown

syntax error, unexpected '->' (T_OBJECT_OPERATOR), expecting ')'