Re: strrchr() bugs
| From: | Adam Maccabee Trachtenberg | Date: | Wed, 16 Jun 2004 18:02:55 +0000 |
| Subject: | Re: strrchr() bugs | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-10535@lists.php.net to get a copy of this message | ||
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.
> So for BC reasons this behavior should not be changed.
Agreed. We shouldn't mess with this function.
-adam
--
adam@trachtenberg.com
author of o'reilly's php cookbook
avoid the holiday rush, buy your copy today!