Bug #2563: strpos returns the same result for "not found" and "found at 1st character"

From: Date: Mon, 18 Oct 1999 22:16:52 +0000
Subject: Bug #2563: strpos returns the same result for "not found" and "found at 1st character"
Groups: php.dev 
Request: Send a blank email to php-dev+get-11752@lists.php.net to get a copy of this message
From: sascha.mantscheff@t-online.de Operating system: Suse Linux PHP version: 3.0.11 PHP Bug Type: Misbehaving function Bug description: strpos returns the same result for "not found" and "found at 1st character" There seems to be no way to programatically differentiate between the meaning "substring not found" and "found at the 1st place in the substring". Consider the statements: if (strpos( "abc", "a" ) == false) echo "false; and if (strpos( "abc", "a" ) == 0) echo "false"; They both print "false", though "a" is a substring of "abc".

« previous php.dev (#11752) next »