private static function getCloner(): AbstractCloner
    {
        if (self::$cloner === null) {
            self::$cloner = new VarCloner();
            self::$cloner->setMaxItems(250);
            self::$cloner->addCasters([
                Stub::class => static function (Stub $v, array $a, Stub $s, $isNested) {
                    return $isNested ? $a : StubCaster::castStub($v, $a, $s, true);
                },
            ]);
        }

        return self::$cloner;
    }