Re: [VOTE] Feature request #38685: str_[i]replace(): Add support for (string needle, array replace)
| From: | Andrey Andreev | Date: | Tue, 03 Feb 2015 11:13:18 +0000 |
| Subject: | Re: [VOTE] Feature request #38685: str_[i]replace(): Add support for (string needle, array replace) | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-81703@lists.php.net to get a copy of this message | ||
On Feb 3, 2015 1:08 PM, "Andrey Andreev" <narf@devilix.net> wrote:
>
> Hi,
>
> On Mon, Feb 2, 2015 at 7:58 PM, François Laupretre <francois@tekwire..net>
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
argued 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.
Or rather, should be covered by strtr().
Cheers,
Andrey.