On Mon, Jan 5, 2015 at 6:20 PM, Andrea Faulds <a...@ajf.me> wrote: > Hey François, > > > On 5 Jan 2015, at 17:15, F & N Laupretre <nf.laupre...@yahoo.fr> wrote: > > > > 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. > > This would have been really useful for me quite recently, I was > disappointed to see it doesn’t already work. Please go ahead with this! > > Thanks. > -- > Andrea Faulds > http://ajf.me/ > > > > > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > 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") => "Array" which also emits a notice. let's see what others think.
-- Ferenc Kovács @Tyr43l - http://tyrael.hu