Re: Regex in PHP
| From: | Nathan Nobbe | Date: | Wed, 04 Jun 2008 16:18:14 +0000 |
| Subject: | Re: Regex in PHP | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-275017@lists.php.net to get a copy of this message | ||
On Wed, Jun 4, 2008 at 10:10 AM, Richard Heyes <richardh@phpguru.org> wrote:
> Hi,
>
> and the case insensitive versions are a hair faster still ;)
>>
>
> Are they? I always thought that case-sensitive functions were faster
> because they have to test fewer comparisons. Eg To test if i == I in a
> case-insensitive fashion requires two comparisons (i == I and i == i)
> whereas a case-sensitive comparison requires only one (i == i).
umm, isnt it like the other way around. in the case of case-sensitive, you
have to be able to distinguish between i and I, whereas w/ the case
insensitive, you dont care so, basically, you strtolower() first thing, then
just compare to lower case characters.
-nathan