Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:118906 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 33292 invoked from network); 28 Oct 2022 17:45:44 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 28 Oct 2022 17:45:44 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 0CDFF180041 for ; Fri, 28 Oct 2022 10:45:44 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-0.2 required=5.0 tests=BAYES_20,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-lf1-f43.google.com (mail-lf1-f43.google.com [209.85.167.43]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Fri, 28 Oct 2022 10:45:43 -0700 (PDT) Received: by mail-lf1-f43.google.com with SMTP id d6so9437029lfs.10 for ; Fri, 28 Oct 2022 10:45:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=datadoghq.com; s=google; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=dyuS1S0+xAi0dmwtaqo38NPWevHQ4NgFjMZ05VHx744=; b=aqsYgTngswirvQASsq2wd7PTDt8jgANWIezDq31tDrzOTvoj/ZVJjGkJUPoNEh8DMG GRCpF4JE53/lZTuVUjCYE2h1IZq0efc9Kv+g87F6dm9r98jugS0RzupofmrtmiHWghuw piLFpr8YnW0hHQwbaQ05F9QBBr4QIO91PYQXw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=dyuS1S0+xAi0dmwtaqo38NPWevHQ4NgFjMZ05VHx744=; b=cTxtVDDsn2jE34nGadfM5g6nXvSqyQopD6ZT0HyTyo7VR7kYefNlzLcepm+Jszavx6 rOxUqas+Km/e6zHltJivcakHwa/uBFkhzAai1znM/h+6PXQ76zhHSEmIEizvhi9ZVKS1 LdZ0weQJ+NBlMxo4KpqU5OqLEj9nxpsn5fmlZ1wf9dPBL117UN0CcEPscUVikTxQ4E9M Uo5SpBZPrxHdsYv1UE5q44/g0zz0zy49CP+8BQtdP/dkXidYIFlQPaUUX31q5qwd9D4t cyWgwnft6x082kFF+7pgdopDoRYKmWVvIp1jNvNSX2S7n2ebWSzoqfC4BTWpW39sqwhj +ujw== X-Gm-Message-State: ACrzQf2GZ6+4AF6HkOvoP0BXPcMpsSMDGoDykClYr83P0VoWPTlyIrlJ M6yQnVkyMCVMlqmBIjbvri+J9zHBwHctxv1UtRRXMCdqR94= X-Google-Smtp-Source: AMsMyM66nwllQC1t9XzTdQWuHgkgdqyuzZDIHdc5+f44lu58d4syK9q/cVR5+aBKwb07zppWvhbRZrYLkWk3nhNtJCI= X-Received: by 2002:a05:6512:2a98:b0:4a2:d66f:c57c with SMTP id dt24-20020a0565122a9800b004a2d66fc57cmr184501lfb.506.1666979142210; Fri, 28 Oct 2022 10:45:42 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Reply-To: Levi Morrison Date: Fri, 28 Oct 2022 11:45:31 -0600 Message-ID: To: tyson andre Cc: "internals@lists.php.net" Content-Type: text/plain; charset="UTF-8" Subject: Re: [PHP-DEV] Proposal: Expanded iterable helper functions and aliasing iterator_to_array in `iterable\` namespace From: internals@lists.php.net ("Levi Morrison via internals") > > There's other functionality that I was less certain about proposing, such as `iterable\keys(iterable $iterable): array`, > > which would work similarly to array_keys but also work on Traversables (e.g. to be used with userland/internal collections, generators, etc.) > > I assume this doesn't care about key uniqueness -- it takes the keys > and makes them values, in the same order they were returned? > > In any case, I don't think this should return an iterable, not array, > to allow for lazy operations in a chain, while also allowing for using > an array as an optimization. Oops, I meant to say I think this should return an iterable, not an array.