The JsonException class

(PHP 7 >= 7.3.0, PHP 8)

Introduction

Exception émise si l'option JSON_THROW_ON_ERROR est définie pour json_encode() ou json_decode(). code contient le type d'erreur, pour les valeurs possible voir json_last_error().

Synopsis de la classe

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