Re: Feature Request #5919 case-insensitive version of str_replace()
| From: | Sara Golemon | Date: | Wed, 29 Jan 2003 21:42:17 +0000 |
| Subject: | Re: Feature Request #5919 case-insensitive version of str_replace() | ||
| References: | 1 2 3 4 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-93775@lists.php.net to get a copy of this message | ||
>> 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