Re: [BugFest] Feature request #38685: str_[i]replace(): Add support for (string needle, array replace)
| From: | Andrey Andreev | Date: | Sat, 10 Jan 2015 16:01:10 +0000 |
| Subject: | Re: [BugFest] Feature request #38685: str_[i]replace(): Add support for (string needle, array replace) | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-80324@lists.php.net to get a copy of this message | ||
Hi,
On Sat, Jan 10, 2015 at 1:53 PM, Nikita Popov <nikita.ppv@gmail.com> wrote:
> But if I see this (taken from the tests) as the search & replacement values...
>
>
> $search=array('[?]',array('(?)','d','e'),'a','R');
> $repl=array(
> array('ap(?)z[?]',"b[?](?)v",null,37,"[?]n[?]"),
> array('a',array('b',null)),
> array('k(?)j[?]')
> );
>
> ... I have a pretty hard time figuring out what this is actually supposed
> to do. At this point str_replace is working on arbitrarily-nested arrays
> and also has four options to control its behavior.
>
> Imho this is just too much complexity for a relatively minor use case.
I have to agree here. Nested arrays are too much ... it should be
limited to single-dimention arrays.
Cheers,
Andrey.