Hi,
Opening the vote for :
https://wiki.php.net/rfc/cyclic-replace
This RFC 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 of the 'replace' array.
Cheers
François
Hi,
Hi,
Opening the vote for :
https://wiki.php.net/rfc/cyclic-replace
This RFC adds support in
str_replace()
andstr_ireplace()
for the
combination of
(string needle, array replace). In this case, each occurrence of the needle
is replaced with an element of the 'replace' array.
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.
Cheers,
Andrey.
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.
Cheers
François
Hi,
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.
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.
I missed the discussion on this entirely. I see it took place in a
non-obvious thread, in which Nikita asked:
When submitting an RFC, please open a separate thread. Otherwise people who
do not follow every single discussion will not see it.
Hi,
Opening the vote for :
https://wiki.php.net/rfc/cyclic-replace
This RFC adds support in
str_replace()
andstr_ireplace()
for the
combination of
(string needle, array replace). In this case, each occurrence of the needle
is replaced with an element of the 'replace' array.Cheers
François
I think I would much prefer a str_replace_callback to compliment
preg_replace_callback. This would make it trivial to implement a
cyclic replacement or any other scheme you desire.
Hi Francois,
On Tue, Feb 3, 2015 at 2:00 AM, François Laupretre francois@tekwire.net
wrote:
Opening the vote for :
https://wiki.php.net/rfc/cyclic-replace
This RFC adds support in
str_replace()
andstr_ireplace()
for the
combination of
(string needle, array replace). In this case, each occurrence of the needle
is replaced with an element of the 'replace' array.
I guess you mean discussion?
Example code would be nice for this RFC.
Regards,
--
Yasuo Ohgaki
yohgaki@ohgaki.net
De : yohgaki@gmail.com [mailto:yohgaki@gmail.com] De la part de Yasuo Ohgaki
Opening the vote for :
I guess you mean discussion?
Actually, I wanted to open the vote, as discussion took place one month ago. But, as people seem to discover the RFC, yes, we're starting another discussion.
Cheers
François
Opening the vote for :
There doesn't seem to be a voting option?
In any case, there are no code examples in that RFC. I think they really
ought to be part of it.
cheers,
Derick