Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:80198 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 65742 invoked from network); 5 Jan 2015 20:30:29 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Jan 2015 20:30:29 -0000 Authentication-Results: pb1.pair.com smtp.mail=ajf@ajf.me; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=ajf@ajf.me; sender-id=pass Received-SPF: pass (pb1.pair.com: domain ajf.me designates 192.64.116.200 as permitted sender) X-PHP-List-Original-Sender: ajf@ajf.me X-Host-Fingerprint: 192.64.116.200 imap1-2.ox.privateemail.com Received: from [192.64.116.200] ([192.64.116.200:38793] helo=imap1-2.ox.privateemail.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 45/A8-21693-464FAA45 for ; Mon, 05 Jan 2015 15:30:29 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.privateemail.com (Postfix) with ESMTP id 46FCFB00093; Mon, 5 Jan 2015 15:30:25 -0500 (EST) X-Virus-Scanned: Debian amavisd-new at imap1.ox.privateemail.com Received: from mail.privateemail.com ([127.0.0.1]) by localhost (imap1.ox.privateemail.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id mC_IsehjNUrs; Mon, 5 Jan 2015 15:30:25 -0500 (EST) Received: from oa-res-26-240.wireless.abdn.ac.uk (oa-res-26-240.wireless.abdn.ac.uk [137.50.26.240]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.privateemail.com (Postfix) with ESMTPSA id 9CAEDB00098; Mon, 5 Jan 2015 15:30:23 -0500 (EST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.1 \(1993\)) In-Reply-To: <54AAF3DE.2050508@gmail.com> Date: Mon, 5 Jan 2015 20:30:21 +0000 Cc: Ferenc Kovacs , nf.laupretre@yahoo.fr, PHP Internals Content-Transfer-Encoding: quoted-printable Message-ID: <14C3C30A-3B71-4DB7-B406-91429A7B05B6@ajf.me> References: <003e01d0290b$2387dd30$6a979790$@yahoo.fr> <54AAF3DE.2050508@gmail.com> To: Stanislav Malyshev X-Mailer: Apple Mail (2.1993) Subject: Re: [PHP-DEV] [BugFest] Feature request #38685: str_[i]replace(): Add support for (string needle, array replace) From: ajf@ajf.me (Andrea Faulds) > On 5 Jan 2015, at 20:28, Stanislav Malyshev = wrote: >=20 > Hi! >=20 >> usually each BC break would warrant an RFC and a vote, but I'm not = sure >> many people would use str_replace("foo", array("bar"), $subject); and >> expect the implicit array to string conversion of array("bar") =3D> = "Array" >> which also emits a notice. >> let's see what others think. >=20 > I wouldn't consider this a BC break. Anybody who relies on implicit > array->string conversion has a bug anyway, and we allow that implicit > conversion to survive only for legacy reasons, but I don't think it > should drag behind itself the promise we'd never support array = parameter > where there was only string before. In summary, I'd say no BC break = here. To add to what Stas says: ZPP doesn=E2=80=99t allow array->string = anyway, this is just a quirk in str_replace=E2=80=99s handling of its = =E2=80=98z=E2=80=99 parameter. So users wouldn=E2=80=99t expect it to = work anyway, right? -- Andrea Faulds http://ajf.me/