public function __toString() { // __toString cannot throw exception // use trigger_error to bypass this limitation try { return $this->toString(); } catch (\Exception $e) { ErrorHandler::convertExceptionToError($e); return ''; } }