kvz/phpjs — pull request #155 by glenara (2014-03-28 03:10:27+00:00)
Title: Update str_ireplace.js

After submitting those bug fixes for str_replace() I thought I should have a look at str_ireplace().
I was surprised to learn that it doesn't take arrays as params, the optional count param, and particularly surprised to see it uses regex expressions with call backs.
Regex expressions are not required and create unnecessary processing.

Since str_replace is 100% compatible with its parent php variant I decided to see if it could be converted.
It turns out that with some pretty minor changes it is easily converted to its php version of str_ireplace().

This version of str_ireplace() is a complete rewrite and has all the code cleanliness and efficiencies of str_replace.

Have a look and see what you think.
Looking at it in the diff view doesn't do it justice with all the deletions highlighted.

I added additional comments so you could see where the modifications to str_replace() occurred.

Anyway, it's here for your consideration.