Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:80185 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 40338 invoked from network); 5 Jan 2015 17:15:07 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Jan 2015 17:15:07 -0000 Authentication-Results: pb1.pair.com smtp.mail=nf.laupretre@yahoo.fr; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=nf.laupretre@yahoo.fr; sender-id=unknown Received-SPF: error (pb1.pair.com: domain yahoo.fr from 212.27.42.2 cause and error) X-PHP-List-Original-Sender: nf.laupretre@yahoo.fr X-Host-Fingerprint: 212.27.42.2 smtp2-g21.free.fr Received: from [212.27.42.2] ([212.27.42.2:27754] helo=smtp2-g21.free.fr) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 56/C3-21693-996CAA45 for ; Mon, 05 Jan 2015 12:15:06 -0500 Received: from moorea (unknown [82.240.16.115]) by smtp2-g21.free.fr (Postfix) with ESMTP id AFF974B0163 for ; Mon, 5 Jan 2015 18:13:12 +0100 (CET) Reply-To: To: Date: Mon, 5 Jan 2015 18:15:00 +0100 Message-ID: <003e01d0290b$2387dd30$6a979790$@yahoo.fr> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Outlook 14.0 Thread-Index: AdApCUVtn1kcVxdUQDCJsXYcft2VAA== Content-Language: fr X-Antivirus: avast! (VPS 150105-0, 05/01/2015), Outbound message X-Antivirus-Status: Clean Subject: [BugFest] Feature request #38685: str_[i]replace(): Add support for (string needle, array replace) From: nf.laupretre@yahoo.fr ("F & N Laupretre") Hi, I just created a PR for a feature request lying around since 2006 : https://github.com/php/php-src/pull/980 It adds support in str_replace() and str_ireplace() for the combination = of (string needle, array replace). In this case, each occurrence of the = needle is replaced with an element f the 'replace' array, looping if = count(replace) is lower than count(needles) in subject. It is interesting for cyclic replacements (alternating line colors, for instance). The PR includes = the needed tests. As the BC break is minimal, do you think it can be merged to the PHP7 = branch or do I need to write an RFC ? Regards, Fran=E7ois