Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:130046 X-Original-To: internals@lists.php.net Delivered-To: internals@lists.php.net Received: from php-smtp4.php.net (php-smtp4.php.net [45.112.84.5]) by lists.php.net (Postfix) with ESMTPS id B8DC21A00BC for ; Sat, 7 Feb 2026 07:16:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1770448593; bh=WPNFIkr3LVABFM6oa5dUdpuNtpLiCI61TS+pfg6Jq64=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=BLdEIKTlB6kMAG6I7xVX9GGe9ERgFzDQXyKNUWtUTpANTRfPFipuqikplYSry4JUj /3VayFnbUfxIKSvPNVTlucMylt+pSCuMNrxWQ9AMsRojfrhoOz2jcISfhPe+4MMeXP RaVBinAuLAxahvnqN36OynEA0tRjEMp5dBu4RfeyR2KoJB7Vj6M5RMt+M9UYYX+aFC 8ihkFscfVlXYxIgfQuEwN6Fv5WJBTbOs4dKxvUbhQnq2W20ZYPD374rcTIZ+pz2auh n1RFyOIOf7ZBn+N6WUujL3bQ9Vj89QeVvqwziEP6KgzIhbUKMPT++TMzr8SwX0Sysp vD4Do8w26pstw== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 513AB180068 for ; Sat, 7 Feb 2026 07:16:32 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=0.6 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_50, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS, FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: No X-Envelope-From: Received: from mail-wr1-f49.google.com (mail-wr1-f49.google.com [209.85.221.49]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Sat, 7 Feb 2026 07:16:32 +0000 (UTC) Received: by mail-wr1-f49.google.com with SMTP id ffacd0b85a97d-43629377370so1482416f8f.3 for ; Fri, 06 Feb 2026 23:16:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1770448586; cv=none; d=google.com; s=arc-20240605; b=iPajI1o4YFNB/438iSKDoQ/tMXwNpXgIpHgXbZgkiwH3AjbPQFViEWdhR8zqWPI6KO dIn7uBafkXyWZWInqToYUY2QnOU9JX10CM1qLTjfNl7n375V3aOAXPQby4QADehzonF1 CopC/Ar6yELaxJ+s0RTfaaC4Sjy4YQjp1WgyTsSoAS6DD0oxbC0viAWjO5M6wXcAfBkB /FUyBqs+aUH6EfKKbFVt5t/2JF9iIke/S5JVork2UinydgAfHLp33CTkYpBIMW2oJXfi /eBL4AWPsDUYC1IWV7GpKt3sZRA8DL3d2URFP5XcDZs6k0ohsN650v+X4tYzGJxUHle/ 5qvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:dkim-signature; bh=NGsYjx64RvhSzVlhOzTIeEtTMygS+r3bT+3p6FInHGY=; fh=0SOKHDtxN71SdNv4anjJSEX4EThjh37ZifyMCk5IQf8=; b=XBl2+y9nZ3FHrFcDpbCzR1ZWGrsonpwO/tKZH5LCt+UAE+xl8Iv+7+tFRt1v76+mn+ SbKAcdSGckdzvONzi/+YNJK5uquSJKP5l/Zn4QoUeQLyIWj9TDdOyBwolSO9tj6i4BEn kv0N4dY485Y/DDOH4TqYGhMV1lh6S1Omm7H7AXR4rHsNr0wjsBQHtSnE2gOghRBZiDOE Credb+qPU0PCB8cdcK/Dikr1187UUoWqt+W15ktY8QP2hm1WgYO8kZTw46r3zvoqY3Bc O9cxN2ONawFytUA7IUUu36oSayR5XfvFm8+p+kK/AQDUVWDK9y4KY+p8ooeN1WDgx0zQ mRxA==; darn=lists.php.net ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1770448586; x=1771053386; darn=lists.php.net; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=NGsYjx64RvhSzVlhOzTIeEtTMygS+r3bT+3p6FInHGY=; b=JIFUIR2P1fd+zEYCNdAeFclN5ga0cNo6fPEZQvkNqqlxLnOD2GDn6q1U5Z0nuHfDLY nGabhFWB0KjY5+BGZlluBJqt5JuEhyvAE07IO1BLf4OhHzddNh0LhUlHbviBY79c+A1c dTvs5zK6gpEf8v/0pNdXSyD1PbFFQ2wBIg6WRqeBkK6cUSfuWx/ifvdWZPAOlXE38jt9 LMrNcKFI5HhUaQmJR7CjfieBkzpbHSkKcj0cxi0kltPssHgxa1ZHRW/XCo5/Y+cW4JSq XzG1VBlkzkmPi9YlV3yHwXfMkMv1zDgElGrmqToSv1HWg0VRH3u1DMIVvemYKllLT9zZ IC4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770448586; x=1771053386; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=NGsYjx64RvhSzVlhOzTIeEtTMygS+r3bT+3p6FInHGY=; b=f3RSfpNAJzHG0TxRchrAqx1zfy0+CHlcwuHSG5SJaoby+W/ylDHZCMX7wyRtJWmYpD ZI/EKZuw2OCWnreaavhbM+Wrh9TxmiPlM1CHvssrIVzk6q5UW4xyTFnaJhxHfY59AsOE TiJnC/0OBOXvib7TRMNJeoxzuyThVIfJQQlk516nei8MrS4XIJJdriVNeGAFvc8u9nba 839d+Gf8M5ZOL7ksqxTZb8wUb1Ib+xDUIT3jzkncWV4kM6vqnRaNTIpnXOEFi+W+7XlL Tot/1xAVMIdyIR6qGiIEBFvVg9aERhtR4AHHjd3FB7LxEh3z9aHrY/sybk01szSpDMPO arDA== X-Gm-Message-State: AOJu0YxWSFvtlAM42wjXR++P9h7Ao66E3PNdcx3SncqNuMPjw99+xdfe rwx91FBltHkR9yqbC31dRHsbhkjT2ERwbptXx6lnvq0n34MPdHWFv/5JxvLqgd0d3iPaofW/Tq5 ITCifxDM36TmkVZHBT++VFzDot6QKZ1w= X-Gm-Gg: AZuq6aIK8gnQXEr4/jqw0sn3N6ClUKbA/qA90u3eWOwefM8LYox0b0jlJUJW39yZ/sN LfFwKGxQf9nZnrvc7j1ZfZg76ydF2cGdSPmNqjgfWSNDF9SO5JWjD0nK2lb4jibywcN2ZCbLAoF IpR+9jqN8hA33jXUOKttuMelF0n3/q+/eXUZE/D2gp6ZYFEP4nYpY7ye1dVE8WbZjq4Ytf9fqRH W1tym0iG3h0CU+wSSPDQ4i5LYryouTyY0AwrkNibvbLx/zDPU11RcWUsItQNRrSumMv X-Received: by 2002:a05:6000:24c7:b0:436:8058:45a with SMTP id ffacd0b85a97d-436805809f4mr162628f8f.39.1770448585499; Fri, 06 Feb 2026 23:16:25 -0800 (PST) Precedence: list list-help: list-unsubscribe: list-post: List-Id: x-ms-reactions: disallow MIME-Version: 1.0 References: <15b6506dc69bd13eceffd36375f83509@bastelstu.be> <20260206233458.6DEF81A00BD@lists.php.net> In-Reply-To: Date: Sat, 7 Feb 2026 08:16:14 +0100 X-Gm-Features: AZwV_QiqDKvu_EEyR31cgFL13T81aB6JD9b8zqfR3ofiQnNAs-K_RjxnFHecn7M Message-ID: Subject: Re: [PHP-DEV] [RFC] [Discussion] Prefix and Suffix Functions To: mickmackusa Cc: internals Content-Type: multipart/alternative; boundary="000000000000082828064a36afba" From: barel.barelon@gmail.com (Barel) --000000000000082828064a36afba Content-Type: text/plain; charset="UTF-8" On Sat, 7 Feb 2026 at 01:13, mickmackusa wrote: > While I am not a voting member of the community, I am unconvinced that > there is a sufficient appetite from the PHP community for this new family > of string functions. > > I mean, when I discussed the possibility of array_transpose(), I could > list nearly 100 Stack Overflow pages that called for such a function > (without all the potential bugs involved with spreading techniques). > https://meta.stackoverflow.com/q/417663/2943403 > > Do you see many calls for your proposed functions in the wild? Are there 5 > questions on Stack Overflow where these functions provide a resounding > benefit? I've hunted a little and haven't found any, but I might be > searching poorly. Are there pre-existing implementations in repos that we > can observe? > > In the absence of real demand, perhaps these should merely be in a > userland library. > > I also agree that the $subject should be the first parameter, like > substr_replace(). > > Mick > > Mick Regarding the order of parameters, the parameters of the _replace function are much closer to what str_replace and preg_replace use instead of what substr_replace uses, that is why I prefer them to follow their closer relatives Carlos --000000000000082828064a36afba Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Sat, 7 Feb 2= 026 at 01:13, mickmackusa <mick= mackusa@gmail.com> wrote:
While I am not a voting member of the co= mmunity, I am unconvinced that there is a sufficient appetite from the PHP = community for this new family of string functions.

I mean, when I discussed the possibility of array_tran= spose(), I could list nearly 100 Stack Overflow pages that called for such = a function (without all the potential bugs involved with spreading techniqu= es).=C2=A0https://meta.stackoverflow.com/q/417663/2943403

Do you see many calls for your pro= posed functions in the wild? Are there 5 questions on Stack Overflow where = these functions provide a resounding benefit? I've hunted a little and = haven't found any, but I might be searching poorly. Are there pre-exist= ing=C2=A0 implementations in repos that we can observe?

In the absence of real demand, perhaps thes= e should merely be in a userland library.

=
I also agree that the $subject should be the first parame= ter, like substr_replace().

Mick

Mick
<= /div>

Regarding the order of parameters, the parameters = of=C2=A0 the _replace function are much closer to what str_replace and preg= _replace use instead of what substr_replace uses, that is why I prefer them= to follow their closer relatives

Carlos
--000000000000082828064a36afba--