php-scalar-objects icon indicating copy to clipboard operation
php-scalar-objects copied to clipboard

String.replace()

Open gossi opened this issue 11 years ago • 1 comments

Hey,

while I do like the two prototypes for String.replace() it's actually an issue to properly document these two methods. I think it would be better to split them into two methods.

  • String.replace($search, $replacement) and
  • String.replaceMap(array $replacementMap)

While I'm not sure about the replaceMap method name. Suggestions are welcome.

gossi

gossi avatar Jun 02 '14 12:06 gossi

I just stumbled upon supplant which is a perfect method name for the latter case. I'd go with it in my own repo gossi/oophp.

gossi avatar Jun 02 '14 14:06 gossi