On Fri, 6 Feb 2026 at 10:53, Ilija Tovilo <[email protected]> wrote:
> Hi Carlos > > On Fri, Feb 6, 2026 at 10:41 AM Barel <[email protected]> wrote: > > > > 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 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 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
