Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:81621 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 93777 invoked from network); 2 Feb 2015 17:35:19 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 2 Feb 2015 17:35:19 -0000 Authentication-Results: pb1.pair.com header.from=leight@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=leight@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.176 as permitted sender) X-PHP-List-Original-Sender: leight@gmail.com X-Host-Fingerprint: 74.125.82.176 mail-we0-f176.google.com Received: from [74.125.82.176] ([74.125.82.176:61335] helo=mail-we0-f176.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 38/CC-34915-555BFC45 for ; Mon, 02 Feb 2015 12:35:18 -0500 Received: by mail-we0-f176.google.com with SMTP id w62so40396989wes.7 for ; Mon, 02 Feb 2015 09:35:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=RUAQnzzY4aPpKMzJ7JesKUCYmT+NDV7DM6djqDEm/pQ=; b=QzUT4X0I7OklULvJuTi9kZCXLpKvyyfp+3lOAGKB7KsolwVT+pH/lrRPWrVPX+YoR+ ouPBcI67y4vl+FdU4JHDFF4/+Z6+t+BPsQ54Gw4VkD/Qg/ya3lMFSTbdCK+3Oy2/WK/P aCSdEQSVC+UoqBW7I01yhtqp5+iZeqzz08/yyX9+I250dlo4mH1mZcMq0bs1R9Esyua6 6kOZ/Qdq5SUzv8DO6GSOaYtQ3nkRHJCyU4GETov0gbKHGtHgqEhEAOVkDR0gLlHCftW0 bAhANXpm6+wvQ2C0djr6Vcf14AWv+t36IHNzj6lJTCFJkek5ktaktiOEWs305qTJh/Cz 0BSA== MIME-Version: 1.0 X-Received: by 10.180.205.142 with SMTP id lg14mr26732443wic.82.1422898514960; Mon, 02 Feb 2015 09:35:14 -0800 (PST) Received: by 10.216.50.139 with HTTP; Mon, 2 Feb 2015 09:35:14 -0800 (PST) In-Reply-To: <009b01d03f09$bd263e00$3772ba00$@tekwire.net> References: <009b01d03f09$bd263e00$3772ba00$@tekwire.net> Date: Mon, 2 Feb 2015 17:35:14 +0000 Message-ID: To: francois@tekwire.net Cc: internals@lists.php.net Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] [VOTE] Feature request #38685: str_[i]replace(): Add support for (string needle, array replace) From: leight@gmail.com (Leigh) On 2 February 2015 at 17:00, Fran=C3=A7ois Laupretre = wrote: > Hi, > > Opening the vote for : > > https://wiki.php.net/rfc/cyclic-replace > > This RFC adds support in str_replace() and str_ireplace() for the > combination of > (string needle, array replace). In this case, each occurrence of the need= le > is replaced with an element of the 'replace' array. > > Cheers > > Fran=C3=A7ois > I think I would much prefer a str_replace_callback to compliment preg_replace_callback. This would make it trivial to implement a cyclic replacement or any other scheme you desire.