JsonException sınıfı

(PHP 7 >= 7.3.0, PHP 8)

Giriş

JSON_THROW_ON_ERROR sabiti atanmışken bir hata oluşursa küresel hata durumunu json_last_error() ve json_last_error_msg() ile ayarlamak yerine bir JsonException atanır. code hata türünü içerir; olası hata türleri için json_last_error() işlevine bakınız.

Sınıf Sözdizimi

classJsonExceptionextendsException {
protectedstring$message = "";
privatestring$string = "";
protectedint$code;
protectedstring$file = "";
protectedint$line;
privatearray$trace = [];
private?Throwable$previous = null;
publicException::__construct(string$message = "", int$code = 0, ?Throwable$previous = null)
finalpublicException::getCode(): int
finalpublicException::getLine(): int
}
To Top