json_last_error_msg

Supported Versions: PHP 5 >= 5.5.0, PHP 7, PHP 8
Returns the error string of the last json_encode() or json_decode() call
json_last_error_msg(): string
        if ($value === false) {

            throw 
JsonEncodingException::forAttribute(

                
$this$keyjson_last_error_msg()

            );

        }
        $json json_encode($this->jsonSerialize(), $options);



        if (
json_last_error() !== JSON_ERROR_NONE) {

            throw 
JsonEncodingException::forModel($thisjson_last_error_msg());

        }



        return 
$json;
        }



        if (! 
$this->hasValidJson(json_last_error())) {

            throw new 
InvalidArgumentException(json_last_error_msg());

        }



        return 
$this->update();
        $json json_encode($this->jsonSerialize(), $options);



        if (
json_last_error() !== JSON_ERROR_NONE) {

            throw 
JsonEncodingException::forResource($thisjson_last_error_msg());

        }



        return 
$json;
            $content $this->morphToJson($content);



            if (
$content === false) {

                throw new 
InvalidArgumentException(json_last_error_msg());

            }

        }