Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:130195 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 706561A00BC for ; Fri, 27 Feb 2026 16:33:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1772209996; bh=F406537fWgnqYftNfmQGxZIFcIPMaLE6zNs6w030kKA=; h=Date:From:To:In-Reply-To:References:Subject:From; b=PABeA2gqnPvN+C6JqPoK455Wv3IRnDG2uDHjG1IeRKaLt2kromDIw7/Wsy5Fsr0CT XqSeAd/MwjYrawEEJWTdudJw6YLHaX9D/lYFjSr4WqAGydxjVe6TFsRHLEcaucg6Jm 5Mk21Qpa+4KedEUimf5cC/wrUiGswrszXFKgyxYz8/hy9Ml23wVMZVSnrQJisl2zu+ Npj4msHBxPFG1Awtv37EDjdR/TG0Dqc6sxovOBI2QzIJXfVZL92kKF0uOrBHGdXfxY PrpMmiw4mkULgJsEXS8SyUr3ISaMdmS1rALRvoN6fWO6KKk6a33YU7tbCZ6s7tgrh/ 9TLXJJS1smORw== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 14AEE180088 for ; Fri, 27 Feb 2026 16:33:14 +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.1 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_MISSING,RCVD_IN_DNSWL_LOW, SPF_HELO_PASS,SPF_NONE autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: No X-Envelope-From: Received: from fout-a3-smtp.messagingengine.com (fout-a3-smtp.messagingengine.com [103.168.172.146]) (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, 27 Feb 2026 16:33:13 +0000 (UTC) Received: from phl-compute-04.internal (phl-compute-04.internal [10.202.2.44]) by mailfout.phl.internal (Postfix) with ESMTP id 48629EC00EB for ; Fri, 27 Feb 2026 11:33:08 -0500 (EST) Received: from phl-imap-02 ([10.202.2.81]) by phl-compute-04.internal (MEProxy); Fri, 27 Feb 2026 11:33:08 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= garfieldtech.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to; s=fm3; t=1772209988; x=1772296388; bh=A8hOTacfuSJl9bcroO2qZ P37FjGua/mFjlBRfl2RTno=; b=rjVe1zyerS/A1RWx++oJyO0wUt0W5csMOfdTD yLxD/tcU1yDy8T70opoB9hn+lefmdl7zuMPVl+RkAMtWnTvuTBvqWds3879hsJrD T6QmUyUn9f5RCQSs+B8tvtsWh5OefOy+U2D0WPfVI8hzQhqM8fdBAnTtenkxoOMc mwdvN/zYvfZmhhokLI6jUZsj8RqdzyN/1lJcZGTbm9DYdqg8yZwE5jkwPznTr5rE 1S/VQRVaBLNoW7DNGbyQSFulldP0lPaBNrrJPsPeZv8qadftTwFFumg0zzXGwJKd ckiPbw/fQnBkKgGwd4uKiZxUojoPPWIXqLpl81IWEaTXKR1Ng== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; t=1772209988; x=1772296388; bh=A 8hOTacfuSJl9bcroO2qZP37FjGua/mFjlBRfl2RTno=; b=jFdk2FB2tj7bEFQo1 uGl0fRbI1OzPyQEMw2ZTnsQv4quJR0STeWwftoMVn1aWbu3jOUMFmntZtpWCJZ5R 4JlGhEptXQ5WiRZFOxVRobIocxxJu57zDelJPeQJWSctBo7poqzbkgNpbvc3CN5w zngCOeXU80+nTV4vB2DX90IMD9261Uqadoz33Thbz8/yoN4+O3//P4CQ7UGBfeZB jZ4WZTJR0sUTkQ6mA59yLuvnoJtOwAhO8L2OKyXgdQEx61I2zXMeboXXjoo6U+dA p/D6mtdvSHgcxy0qupRMAcrKZPV9hv9QvgbDxSYQR2YC2HsxyODITZ56gttXYDqo HXZBA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgddvgeelhedtucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf gurhepofggfffhvffkjghfufgtgfesthejredtredttdenucfhrhhomhepfdfnrghrrhih ucfirghrfhhivghlugdfuceolhgrrhhrhiesghgrrhhfihgvlhguthgvtghhrdgtohhmqe enucggtffrrghtthgvrhhnpeeuvedvudfhffffhfelueehvdejvefgleegteegffetudef leehgeefvdehgeelteenucffohhmrghinhepphhhphdrnhgvthenucevlhhushhtvghruf hiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehlrghrrhihsehgrghrfhhivghl ughtvggthhdrtghomhdpnhgspghrtghpthhtohepuddpmhhouggvpehsmhhtphhouhhtpd hrtghpthhtohepihhnthgvrhhnrghlsheslhhishhtshdrphhhphdrnhgvth X-ME-Proxy: Feedback-ID: i8414410d:Fastmail Received: by mailuser.phl.internal (Postfix, from userid 501) id D5C34700065; Fri, 27 Feb 2026 11:33:07 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface Precedence: list list-help: list-unsubscribe: list-post: List-Id: x-ms-reactions: disallow MIME-Version: 1.0 X-ThreadId: AyshEWc3h6_7 Date: Fri, 27 Feb 2026 10:32:47 -0600 To: "php internals" Message-ID: <09e17a8d-5d40-4b69-bd3f-3e73a7b998b6@app.fastmail.com> In-Reply-To: References: Subject: Re: [PHP-DEV] [RFC] [VOTE] Prefix and Suffix Functions Content-Type: text/plain Content-Transfer-Encoding: 7bit From: larry@garfieldtech.com ("Larry Garfield") On Fri, Feb 27, 2026, at 10:24 AM, Bob Weinand wrote: > Hey Carlos, > > On 27.2.2026 14:31:16, Barel wrote: >> Hi everyone, >> >> This is to announce the opening of the vote for the Prefix and Suffix Functions RFC >> >> RFC: https://wiki.php.net/rfc/prefix_suffix_functions >> Discussion thread: https://news-web.php.net/php.internals/129842 >> >> The vote will be open for 2 weeks (and a few hours), closing on March >> 13th at midnight UTC. >> >> Cheers >> >> Carlos > > > I like this RFC very much. I think every addition to the standard > library needs to be well considered, but this one definitely crosses > the bar. > > Simple prefix and suffix operations are quite common - especially in > scripting and manipulation of well-known strings. > > > > While you certainly can write these with substr, it often either > duplicates the string for the length or just hardcodes the length, both > of which are equally ugly. > Sure, users can write helper functions for these, but I find below a > certain size, users typically don't. > > Thus I think this proposed change will lead to simpler and less > error-prone code. I know I personally would use the _ensure_() functions quite frequently in a project of mine. Hence my yes vote. Though I would also question why so many people are voting for $subject-last for the secondary vote. --Larry Garfield