PHP 4.0 Bug #6312: return of strpos and strrpos functions
| From: | God_is_so_good at hotmail dot com | Date: | Wed, 23 Aug 2000 13:36:44 +0000 |
| Subject: | PHP 4.0 Bug #6312: return of strpos and strrpos functions | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-30368@lists.php.net to get a copy of this message | ||
From: God_is_so_good@hotmail.com
Operating system: Linux
PHP version: 4.0.0
PHP Bug Type: Scripting Engine problem
Bug description: return of strpos and strrpos functions
i think that this is not properly a bug, but an good sugestion...
the returned values of the strpos and strrpos functions are NULL for non-matching, ZERO when the
match ocurred at the first position of the string, ONE when the match ocurred at the second
position, and so on. on the following sample, if $gbProcessStatus matches de "A" on the
first string, the code within the if will not get run...
...
if ( strpos ( "AC", $gbProcessStatus ) ) )
{
// do something
}
...
at my view point, a nice value returned from these functions would be ZERO or NULL for non-matching,
ONE for the first match, and so on...
hope this was an useful note,
Sidney Amaral