Re: strrchr() bugs
| From: | Derick Rethans | Date: | Thu, 17 Jun 2004 07:28:10 +0000 |
| Subject: | Re: strrchr() bugs | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-10558@lists.php.net to get a copy of this message | ||
On Wed, 16 Jun 2004, Adam Maccabee Trachtenberg wrote:
> On Wed, 16 Jun 2004, Hartmut Holzgraefe wrote:
>
> > > 1) strrpos('abcd', '') returns 4. Expected FALSE
> > Although one could argue whether searching for empty
> > strings makes sense at all the result is not completely
> > wrong. There *is* an empty string at the end of the haystack ...
>
> And at the beginning of the haystack and also in between each and
> every letter. :)
>
> Logically, it would probably be best to return 0 because that's where
> the first empty string occurs.
Erm, no. It's strRpos (reverse), so it should find the one at the end
first.
Derick