>> I may be wrong since I haven't profiled this, but my understanding is
>> that str_replace is much faster than doing either of the regex
>> replacements.  For that reason alone, there is a use for it.
>
> Normally it would be quite faster, however once case sensitivity is
> added to  the mix I believe the speed difference would be minimal.
>
I don't even see the speed difference as an issue as much as (A)
simplicity for the user who hasn't figured out regex yet, (B) consistency
(we have 'i' versions of most other string functions, why not this one?)

The parameter accepting still needs to be fixed though, I copied most of
the str_ireplace code from str_replace and forgot to clean that section up
and make it nicer.  I'll save that for *if* a quorum can be reached to
include it at all.

On a related topic, the 'boyer' option of str_replace isn't even
documented.  That alternate method of performing str_replaces look like
it's a bit more efficient (no benchmarkes atm) but I'm wondering if
there's a specific reasons why it wasn't documented yet.

-Pollita




-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to