Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:130026 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 131061A00BC for ; Fri, 6 Feb 2026 10:20:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1770373212; bh=FL8mjW98BFAWBsQ3/qfEa4Oo2rFLfBhU+meX8s1hpG0=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=OS3uwWiUUe1vi5dDrXJXMvCeNtFDNmofLJxIfe8lLt/c47LK3sbI5j1WmAgOJIGQj Nk85TAM63pSDmS2/hIW8s8cZQ2TPV+hZXBzRDKGsbymDh0aNgsRMdqykXooyCtMRUZ 9n3OVNCoy22sCXaDZ+HayDVZ/vBt406I1xygV/roMfjlVqmJ4V6dZQ7uWz6BYyPgmv oVQAnh3oG3Z9ew+RwRF/8wgm0h1Xrk1BKh2Jeh6Ns7oRgDnFW4vrxodo29svvuWoNW AjKsi1CYXnayQs/ZDH5rsHxB8TYRuVo+zuY058XoULfO2H2jFoqDe52BdPDFFA0Jku gc5Gp6tGYbTpA== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id E56A91801D4 for ; Fri, 6 Feb 2026 10:20:11 +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-f47.google.com (mail-wr1-f47.google.com [209.85.221.47]) (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 ; Fri, 6 Feb 2026 10:20:11 +0000 (UTC) Received: by mail-wr1-f47.google.com with SMTP id ffacd0b85a97d-4327790c4e9so1129591f8f.2 for ; Fri, 06 Feb 2026 02:20:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1770373205; cv=none; d=google.com; s=arc-20240605; b=hHTOV3W/SOdBjVqPx1qGT7Ce/Bap/yCEe0tvnl3+4IuBS6Wk2zIwLCZFdClwm5ytPu SjuPIhhC5644T9t+xidm/bPdt/JAyz41KvKYC6Zkz6PMsWokL6sTZ6vyi5jxthLUZFxw dyXcQ5zxpxcsvxNjAiiwqaqNxA4NKFyO0bAI5cPiKdGgjcVDbOgFbVVBZBDThiia7373 2+dXycwCZ4m/pJrNx9kSUPYlibB41hsf9XICDAKrNflpCIclXqGvnzAsDOS3xQu8Cski 0dYA8i8FGFYYvSA5U9bs/3yuw3izXGrBmzxIW+nqKHEC/2HbQhrvrilG7mXitzn5k5B2 YMEw== 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=R09h2tKIOt6x2Gw1Xl5QajVSKOqMhnk+S93pG6Lfog0=; fh=xtZ9pwr8lK8jqbQIqecBsUFXoa/OsBi88Rsl3pGkTW8=; b=Soxxp9u1soDmH7wYFBh3iZrEqs/qrjdRKUPDveSfLH2PdGCKl8ZkKqFA+JPoTCnJeB hcUK9ZCLhgNkoNtLlVyzz2+SO2hUMMSBFFBQwps2BgjFtToKxwqT2JCOLzHaUsHZ8fjs rtTVLN4Y6h/ki5xY4oJNhd6uAtlbde0B8TK7vuj+gAgzAfid6N27tI9QF6Se82pmsvYY 8WIS3gDUQnoDiyZ5jodlD5jioi93VKCiR1Us++Dm/rOkEMPKEiAnAFUgIGaVvSzzr1ry g9G7aOf2a16xsXq6owdPAUtrkKvsY9aEqEVUiB8WPtqyvHU7zUAkC8GhhzJZCDec7gGa m9Yw==; 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=1770373205; x=1770978005; 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=R09h2tKIOt6x2Gw1Xl5QajVSKOqMhnk+S93pG6Lfog0=; b=Sko/UbshjratIEHFfLs3j+PvWTCZ9vUhScws1Q9mbC+KwPJiRNYJZwLmyob6tXuTnm lnPXWVgCY9UnmtnZv0vksZRXFDdO94JcJZU1qYhcHwa8hpCB4Z/Km4/WlSxXu0aonRll NqgOliTj0UT22ZtiBIX0aeEYLmLBkMCpTmuOsEG5dZr86ka1sOFb5maAHlFyGnIf5VoM U3UuuMg4TxurOnd9NR1pp3bHERAfUFD7BkZi5DN682TbaJz7tXQVCHxuDnddK+Zz3HKZ YCzwZ4s0w9/sOP0yxG57SG9JR0tHxnuIG+dTFIi1dopWttaQlH35xje2Vh1LOphHjt+G +4tQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770373205; x=1770978005; 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=R09h2tKIOt6x2Gw1Xl5QajVSKOqMhnk+S93pG6Lfog0=; b=oCaLMJ7oKwHwOBGkGvVlvWwXMXudM3BI7oqVKXdM6ELYrw8qjX21RXixqT8ti38PmJ bsli7wRlERUQnFHWwyR/DLyA/BdSdHaXdP5crzVmiPSr/phW0Wd6RxLbFDxct4PjMQV4 0JJ+g3O5gkYxPfV6e1hu62OnbmsjxfTwdXql4Pl2D5UlX+zyUwLhMl/iBT+kJXuUUNgm 1kFyCawb6N6HmRc+36WI+/o21auTh0XYaGxot1bVHS6+LnWbIsd4KsVGs2DUkZ+0yDDp jTo0mWP5rO3OvWgsYpl/j+uJjCAvkaOTkRvQAHKKMiuTC2K4fwBqRya4HjCpmuS7LLPk J3Sg== X-Gm-Message-State: AOJu0YwDrT29rUtB0KVZKF2xC9lGArzLpuSI+cUvtLPKwZHXqdFUyWD7 CGgffm2BTtYYrFX7ryIvenzaxmXY2QnrJfjmSB0pyEu83iz1xxOUwUy07bfYNdcyKTeyguBizpE UwVS0mCiksuobVXP276OwNgx3wCaIjkkI13PZ2zk= X-Gm-Gg: AZuq6aL55sNRY4qqRgC6ZWlRqlbnGhousxwaPt2pR61VdpP8wtx/30YdQYet5ZMka8b y/TpALtt6CaOXv7raYiMxaGWz0dt4TEnqOWflrM5myMcDj3vH5EHK/uoGQEuqvwR6rDfl2Uz1lA hqPvwFTncvaP0K/8DTC4EzRJb6+oZS2SSLkdQZl3XQiAIrSgpXxy5o0s9Bk3YSHgpMWbirJ+6dn ArcrujLV4Q0Q4KUMkoVXGcyo3TBh8VUIjKJuBVeDB5Ln9kL/vMEZnh0kiRNR5RPNfyD X-Received: by 2002:a05:6000:2889:b0:436:1116:fea0 with SMTP id ffacd0b85a97d-436293b267dmr2911485f8f.59.1770373205087; Fri, 06 Feb 2026 02:20:05 -0800 (PST) Precedence: list list-help: list-unsubscribe: list-post: List-Id: x-ms-reactions: disallow MIME-Version: 1.0 References: <15b6506dc69bd13eceffd36375f83509@bastelstu.be> In-Reply-To: Date: Fri, 6 Feb 2026 11:19:53 +0100 X-Gm-Features: AZwV_Qh_qWqE7z13WynyNqK_apQ1J8wEOP8FNqO_ZksCUEoLQhzqTibN8olnYl0 Message-ID: Subject: Re: [PHP-DEV] [RFC] [Discussion] Prefix and Suffix Functions To: Ilija Tovilo Cc: PHP internals Content-Type: multipart/alternative; boundary="0000000000000264ab064a252296" From: barel.barelon@gmail.com (Barel) --0000000000000264ab064a252296 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, 6 Feb 2026 at 10:53, Ilija Tovilo wrote: > Hi Carlos > > On Fri, Feb 6, 2026 at 10:41=E2=80=AFAM Barel w= rote: > > > > It's been 14 days since the last change to the RFC and there have been > no further discussions, so the cooldown period is over and I would like t= o > announce the start of the voting > > > > Link to the RFC for reference: > https://wiki.php.net/rfc/prefix_suffix_functions > > Sorry for my late feedback. > > What's the rationale for $subject being the last parameter only in > str_prefix_replace() and str_suffix_replace()? I feel pretty strongly > that the subject should always be the first parameter. We don't want > to add to the classic haystack/needle confusion. > > Regards, > Ilija > Hi Ilija These new functions follow the format of their closest existing relatives, thus the _ensure and _remove functions follow the format of the str_starts_with, str_ends_with and str_contains functions where the subject is the first parameter, while the _replace functions follow the format of the str_replace and preg_replace functions where the subject is the last parameter. It is unfortunate that these two groups of functions follow different standards but I thought it would be better to keep as close to existing functions as possible Cheers Carlos --0000000000000264ab064a252296 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Fri, 6 Feb 2= 026 at 10:53, Ilija Tovilo <to= vilo.ilija@gmail.com> wrote:
Hi Carlos

On Fri, Feb 6, 2026 at 10:41=E2=80=AFAM Barel <barel.barelon@gmail.com> wrote:<= br> >
> It's been 14 days since the last change to the RFC and there have = been no further discussions, so the cooldown period is over and I would lik= e to announce the start of the voting
>
> Link to the RFC for reference: https://wiki.php= .net/rfc/prefix_suffix_functions

Sorry for my late feedback.

What's the rationale for $subject being the last parameter only in
str_prefix_replace() and str_suffix_replace()? I feel pretty strongly
that the subject should always be the first parameter. We don't want to add to the classic haystack/needle confusion.

Regards,
Ilija

Hi Ilija

These new functions follow the format of their closest existing relatives,= thus=C2=A0 the _ensure and=C2=A0_remove functions follow the format of the= str_starts_with, str_ends_with and str_contains functions where the subjec= t is the first parameter, while the _replace functions follow the format of= the str_replace and preg_replace functions where the subject is the last p= arameter. It is unfortunate that these two groups of functions follow diffe= rent standards but I thought it would be better to keep as close to existin= g functions as possible

Cheers

Carlos
--0000000000000264ab064a252296--