Oops! An exception encountered.

syntax error, unexpected '$ch' (T_VARIABLE), expecting ']'