Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:81702 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 85651 invoked from network); 3 Feb 2015 11:09:05 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 Feb 2015 11:09:05 -0000 Authentication-Results: pb1.pair.com header.from=narf@devilix.net; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=narf@devilix.net; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain devilix.net designates 209.85.214.177 as permitted sender) X-PHP-List-Original-Sender: narf@devilix.net X-Host-Fingerprint: 209.85.214.177 mail-ob0-f177.google.com Received: from [209.85.214.177] ([209.85.214.177:62559] helo=mail-ob0-f177.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B2/8A-20608-E4CA0D45 for ; Tue, 03 Feb 2015 06:09:05 -0500 Received: by mail-ob0-f177.google.com with SMTP id wp18so17747589obc.8 for ; Tue, 03 Feb 2015 03:08:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=devilix.net; s=google; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=oYfBBinWo5CcZ9ru4AD5QEG1WCsB+FJySI36m9XN4+g=; b=Qfa1YTbBud/OSXYRAB/9STG3/WYj0k/JNELOJAvoCiZCAqcURrhCONXbFMR9DyIch9 R+GQVvAN1ZUUTEofyV8VR1t6Z344Jg7NUf53bTkldjhtwTDjTs+ENen5fTv3sKRsBzbz lFJeN5lxyEUTdSPVoqXxg15KsEUVL2fqlOtDM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=oYfBBinWo5CcZ9ru4AD5QEG1WCsB+FJySI36m9XN4+g=; b=VuDJpUBLrF4WZnNQIPKRUr1qIgqjo3Pfd9/HHfVtqIc0eyviYSxFpF2Z/h7bmfwFs5 3b9Aef2cm6/kiQDyLuLA3kNehro9Ko/TYRth0dYSV7+DYtxJD4OaTxWMAc4GTokk2mg1 WFJE7J7RAjphNY3VjQv6CMJpb6J17cc1lOKSz16qx9TSIeiv/qsKNnmMeyqurX1VYFep LYyWySdQQrA/pRk38sTPjUfC3mk24+sP9iQHjA/7yfK1fpr5jdQYGWALGlGfUk8sFWUj vGfa8WDj4kkXHaN+BK7thSbGNb1h/C93wp27v1ZJR99CRz4M/1F17TbqHSnAFtqxa0ie 9CfQ== X-Gm-Message-State: ALoCoQlmh9cVTz+dqMjuodcHfhr6wEjHKLCf6vgeiss9BM+8sy+86gclENqTmEJ0287BSDfCM4KU MIME-Version: 1.0 X-Received: by 10.182.81.98 with SMTP id z2mr15167418obx.35.1422961739447; Tue, 03 Feb 2015 03:08:59 -0800 (PST) Received: by 10.202.214.205 with HTTP; Tue, 3 Feb 2015 03:08:59 -0800 (PST) In-Reply-To: <00b401d03f11$d01d27f0$705777d0$@tekwire.net> References: <009b01d03f09$bd263e00$3772ba00$@tekwire.net> <00b401d03f11$d01d27f0$705777d0$@tekwire.net> Date: Tue, 3 Feb 2015 13:08:59 +0200 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: narf@devilix.net (Andrey Andreev) Hi, On Mon, Feb 2, 2015 at 7:58 PM, Fran=C3=A7ois Laupretre wrote: >> De : Andrey Andreev [mailto:narf@devilix.net] >> >> I seem to have missed the new parameter (and constants) addition >> during the discussion ... sorry to say this, but that one would >> probably fail the RFC. > > Mmh... I don't like the idea of adding a parameter but several people arg= ued that we needed a way to control looping behavior, as the original idea = was to loop through the replace array. > > But I am still hesitating. > > Instead of voting on the RFC, please tell me which behavior you prefer : > > - an options argument to decide on the looping behavior, > - always stopping replacements when the replace array is exhausted > - always looping > > The other options are too exotic to become the default behavior. > Always looping, the other option is already covered by strtr(). I'd like control over the behavior too, but that just makes the API really = ugly. Cheers, Andrey.