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
On Wed, 16 Jun 2004, Hartmut Holzgraefe wrote:
> It should still find the *last* emtpy string, not the first,
> shouldn't it? ;)
Yup. I think we've now spent more time discussing this function than
people have spent using it. :)
-adam
--
[EMAIL PROTECTED]
author of o'reilly's php cookbook
avoi
Ard Biesheuvel wrote:
Hartmut Holzgraefe wrote:
Adam Maccabee Trachtenberg wrote:
Logically, it would probably be best to return 0 because that's where
the first empty string occurs.
this is strrchr(), not strchr() ;)
Actually it's strrpos(), not str[r]chr() [look at Alexander's code],
which _ha
Hartmut Holzgraefe wrote:
Adam Maccabee Trachtenberg wrote:
Logically, it would probably be best to return 0 because that's where
the first empty string occurs.
this is strrchr(), not strchr() ;)
Actually it's strrpos(), not str[r]chr() [look at Alexander's code],
which _has_ been rewritten in
Adam Maccabee Trachtenberg wrote:
Logically, it would probably be best to return 0 because that's where
the first empty string occurs.
this is strrchr(), not strchr() ;)
--
Hartmut Holzgraefe <[EMAIL PROTECTED]>
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http:
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 beginn
Alexander Valyalkin wrote:
Today I've revised strrchr() function in PHP4.3.7 sources.
It wasn't binary-safe. For example:
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* a
Today I've revised strrchr() function in PHP4.3.7 sources.
It wasn't binary-safe. For example:
1) strrpos('abcd', '') returns 4. Expected FALSE
2) strrpos("a\0abcde", 'a') returns 6. Expected 2
3) strrpos("a\0bcde", "\0") returns 6. Expected 1
4) strrpos('', '\0') returns 0. Expected FALSE
My versi