public function decode($json, $assoc = false, $depth = 512, $options = 0)
    {
        $result = json_decode((string) $json, (bool) $assoc, (int) $depth, (int) $options);
        if (null === $result && JSON_ERROR_NONE !== json_last_error()) {
            throw new RuntimeException(
                json_last_error_msg(),
                json_last_error()
            );
        }

        return $result;
    }