public function decode(string $json, int $options = null)
    {
        if ($options !== null) {
            return (clone $this)->decode($json);
        }

        $shouldBeArray = $this->hasOption(\JSON_OBJECT_AS_ARRAY);

        return $this->wrap(function () use ($json, $shouldBeArray) {
            return @\json_decode($json, $shouldBeArray, $this->getRecursionDepth(), $this->getOptions());
        });
    }