Bug #912: strpos returns 0, when strpos("abc", "a") returns 0, should be -1
| From: | haktan at cybercity dot dk | Date: | Thu, 12 Nov 1998 12:48:57 +0000 |
| Subject: | Bug #912: strpos returns 0, when strpos("abc", "a") returns 0, should be -1 | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-2351@lists.php.net to get a copy of this message | ||
From: haktan@cybercity.dk
Operating system: FreeBSD
PHP version: 3.0.5
PHP Bug Type: Misbehaving function
Bug description: strpos returns 0, when strpos("abc", "a") returns 0, should be
-1
strpos("abc","a") returns 0 because "a" is found at index 0.
strpos("abc","x") also returns 0 because "x" is not found.
It would be better if strpos returns -1 when search-string
not found.
-- Haktan Bulut
--
PHP Development Mailing List http://www.php.net/
To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net
For help: php-dev-help@lists.php.net