public function keys(bool $recursive = false, $search_value = null, bool $strict = true): self
    {

        // recursive

        if ($recursive === true) {
            if ($search_value === null) {
                $array = $this->array_keys_recursive($this->getArray());
            } else {
                $array = $this->array_keys_recursive($this->getArray(), $search_value, $strict);
            }

            return static::create(
                $array,
                $this->iteratorClass,
                false
            );
        }

        // non recursive

        if ($search_value === null) {
            $arrayFunction = function () {
                foreach ($this->getGenerator() as $key => $value) {
                    yield $key;
                }
            };
        } else {
            $arrayFunction = function () use ($search_value, $strict) {
                foreach ($this->getGenerator() as $key => $value) {
                    if ($strict) {
                        if ($search_value === $value) {
                            yield $key;
                        }
                    } else {
                        /** @noinspection NestedPositiveIfStatementsInspection */
                        if ($search_value == $value) {
                            yield $key;
                        }
                    }
                }
            };
        }

        return static::create(
            $arrayFunction,
            $this->iteratorClass,
            false
        );
    }