Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:119449 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 71663 invoked from network); 1 Feb 2023 19:55:20 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 1 Feb 2023 19:55:20 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 9E120180543 for ; Wed, 1 Feb 2023 11:55:19 -0800 (PST) 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.0 required=5.0 tests=BAYES_20,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,HTML_MESSAGE,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-yb1-f172.google.com (mail-yb1-f172.google.com [209.85.219.172]) (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 ; Wed, 1 Feb 2023 11:55:19 -0800 (PST) Received: by mail-yb1-f172.google.com with SMTP id 129so23813919ybb.0 for ; Wed, 01 Feb 2023 11:55:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=U4LWe3qzFm7aGmx9btqyplc4UDh7rBMavYlJHByllRg=; b=Ce0tUnQjO78zGo/IHFvMQ8l4X82F/Mgm0zqqxO51qbM2WuQ3fcj0qhcDzbD6zVwx3c Pj+3ahynDRSHVzRuDB+LvH12BiRwc2h1NrYBpTJ18XNlWHR2UuNR7Kf8WaKXpEjgis9A sx1lunQPGHnNkBq3gPjCoU+QRL5gBI9IUTe43QG7Pwgn/ObZPsB8dK+hvAg8YYIJCdsm 3g5Yz70ZMiR/jxqfRYfGVTA5k+8yqg1qGi6JbZd1gczQmpPxGidRhmXm1tLn42uYDNqk GkbaFScN8JyykkGcL4OTdhO5+mRM9n24rH67Y4edjWZ/eRFMpZaTavwOzh14V/Abpr9i HgLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=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=U4LWe3qzFm7aGmx9btqyplc4UDh7rBMavYlJHByllRg=; b=U3w0ZsILJoVZsNS1dvflfbydbUAnwLk7K0QLiPS0lKJ/OXCqw7Dpn7eE2SYFte2FiJ 4h5zQR6jsPq2vxxcvuT4agoXW2SmbRyVc7XG72G+tVsea097KZk++/9w0Wo2YZM44eky dtxGAmopg2yX+xqp35NAWluPJovD/CbxkgzrFg5RpL6cHitH9dhJ2A75Uo7EtcmVifiM ANVaVSLQlZqIBqzWm1qAknJbMvg4pPd/SYOCjaCQ6ukn7E2+bb/QCXehj3bl0z3P9K3g 4/Svko9QtPPsqAAImU3BMnigBeLlaxM8ASFM/qK8Ixil403m2w1I50wCnZHxOjnybiOu zN6g== X-Gm-Message-State: AO0yUKXPHVacFWSYO+d6sjTt4kipe8abcGM0A6FiPOGvxCI1iV2ml1kc POofb1jTh+uFHfFzRRcVKum0JQ09aR6muz8wEpc= X-Google-Smtp-Source: AK7set/AE4rsqPfpkzR5gsfux15tndoHagWIViTwJaqpQvXs9Kj4FACh8Dkh69VgLR3oOuU0UM4Z6p/WZPLQgH6jhnk= X-Received: by 2002:a25:aac8:0:b0:80b:9825:abc0 with SMTP id t66-20020a25aac8000000b0080b9825abc0mr469093ybi.28.1675281318692; Wed, 01 Feb 2023 11:55:18 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: Date: Wed, 1 Feb 2023 19:55:07 +0000 Message-ID: To: Sergii Shymko , PHP internals Content-Type: multipart/alternative; boundary="000000000000e6507d05f3a8d3ea" Subject: Re: [PHP-DEV] RFC proposal: function array_filter_list() to avoid subtle bugs/workarounds From: tekiela246@gmail.com (Kamil Tekiela) --000000000000e6507d05f3a8d3ea Content-Type: text/plain; charset="UTF-8" Hi Sergii, First of all, let me say that I am glad more people are willing to give back to the PHP language. I'm happy you decided to join the ML. However, the change you are proposing is unlikely to be well-received. PHP already has too many functions. It is known as a kitchen sink[1]. I don't think we need list-variants of the array functions. As you noted yourself, it can be simply implemented with array_values(). If we do this one then next someone will say what about array_diff() with a list? Most of the functionality can be implemented in userland and it's usually the preferred way. If we are going to add a new function to PHP, it must have a very good reason to be implemented in C. array_is_list() had a very good explanation: performance. Ideally, we would have a separate type for List, but... it can easily be implemented in userland so we are back to square one. While PHP's arrays are something of a Frankenstein's monster, they work well as an internal implementation detail of other data structures. Adding more array_* functions is something that many of us would want to avoid. Regards, Kamil [1]: https://web.archive.org/web/20181107125816/http://www.mcguirehimself.com/?p=117 --000000000000e6507d05f3a8d3ea--