public function decode(string $json)
    {
        // max depth is 0+ for json_encode(), and 1+ for json_decode()
        $result = json_decode($json, $this->decodeObjectAsArray, $this->maxDepth + 1, $this->options);

        $this->checkLastError();

        return $result;
    }