JsonException クラス

(PHP 7 >= 7.3.0, PHP 8)

はじめに

JSON_THROW_ON_ERROR オプションが json_encode()json_decode() に設定されていた場合にスローされる例外です。 code には、エラーのタイプを含みます。 あり得る code の値については、 json_last_error() 関数を参照ください。

クラス概要

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