Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:115110 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 68222 invoked from network); 24 Jun 2021 10:58:50 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 24 Jun 2021 10:58:50 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 6269F1804CC for ; Thu, 24 Jun 2021 04:17:35 -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=-1.8 required=5.0 tests=BAYES_00,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 autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail-qk1-f181.google.com (mail-qk1-f181.google.com [209.85.222.181]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Thu, 24 Jun 2021 04:17:35 -0700 (PDT) Received: by mail-qk1-f181.google.com with SMTP id g4so13504151qkl.1 for ; Thu, 24 Jun 2021 04:17:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=XiJOAju+u6BqsQBH3+8ZTXb4GcRaOsnaxARzEzJY+I0=; b=hNH+DCM/XqGFEtRN2/pFHxDBbjuXSaMGNPprrS7m2irgQJytr9aShfUbfgBIDsfiG2 QGSJMuMUJSoQfrOOrvsGLHuIkFzOqxcYl8i+M3XxRIbrlpU4qHr2H/GSXgajTzMobE/M gpOVEzaLi3G6vGnr3kEaa1pB+S39G00cS9J6IDWZUSMnjMM9nG9JQbnfUk9KZig/+h9W k09am+Qsd2dLe9GidwNZncXVWq/QMMch7F/38rb/ApxHDBKXoKuYBVBPxLYenFmK1jiW DOkjkYSb6Jg9xubESNQ+JzmJYXf52+RHiF14lsH2Bau1EzauF4cUrrzIoHivtVIswWD6 3oiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=XiJOAju+u6BqsQBH3+8ZTXb4GcRaOsnaxARzEzJY+I0=; b=BDoRgUF8sbk4io5fiZp1V4Dh6T3beCGWs+sfrie4OuRaAlnY8ZTPIu9tSTDryM/AH9 ZuDiee41dR/ZEr1rV9qUQ1TDsTobsA5xQKKBpKAWVHKYwwuVAImqmZM0f1PlespIngnU 0eUv2G10+hyzQ9WnIwy5WOKwl9LwXQgSnEbhqGl+MXpI4Lb1JsBNrEd6i2k0CX6/B3NF SC0vsKCL9UJJuo3D1yIDS2AKDkrepRen2gxRKZuOXCUpicxa1g/SXw+qPZh795Nihft7 NtD0lm3Vsll0lGdAYb8I7PP3+hrvZ0bAUjDBS3Z/0RYK4ErEbSsX+Q/ca+aYGh217eo8 ri8g== X-Gm-Message-State: AOAM533ZjR/cq70DtP0KF6S3+ojnnFeJGIB5oD6POPRpeNahhgOnEAWE zEHA2lnJL6nXZsKhJBABTj0bg5OlWK5m3GcOnHE= X-Google-Smtp-Source: ABdhPJwa2xQdPyU5T5OKYSEY7SdYsY5qaa5+j80z/FcSo6qeBHlLSneFfQDJ2iw7cjuVKmo0J8hwjCWMAmreY/crR9c= X-Received: by 2002:a05:620a:21cc:: with SMTP id h12mr1874408qka.342.1624533454222; Thu, 24 Jun 2021 04:17:34 -0700 (PDT) MIME-Version: 1.0 References: <012901d7683a$446a7ba0$cd3f72e0$@gmail.com> In-Reply-To: Date: Thu, 24 Jun 2021 12:17:26 +0100 Message-ID: To: Guilliam Xavier Cc: Sara Golemon , PHP internals Content-Type: multipart/alternative; boundary="00000000000076f9f705c5812b13" Subject: Re: [PHP-DEV] Introduce str_left/right In 8.1 From: tekiela246@gmail.com (Kamil Tekiela) --00000000000076f9f705c5812b13 Content-Type: text/plain; charset="UTF-8" I am against adding these functions, but for different reasons than Sara and George. If we add str_left and str_right then there should be a corresponding variant in mbstring. The byte-string functions are rarely useful. Adding these functions to mbstring unnecessarily complicates the extension for little to no gain. Another point is that if we decide to add them, then we will bikeshed forever in an unresolvable manner about the name. Should it be called str_left or strleft? Current functions don't have a naming convention, so using either variant will be wrong. Personally, I find substr to be more clear about the intent. I know that I am asking for a part of the string. Whereas str_left doesn't convey an action immediately. Without knowing its purpose I wouldn't know if it will pad the string from the left, strip characters from left, or take the leftmost part of the string. Don't take it the wrong way, but I think it's a waste of time to implement a function that doesn't even need a polyfill in the userland. Regards, Kamil --00000000000076f9f705c5812b13--