php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #1234 STRPOS substring not found / found on Position 0
Submitted: 1999-03-14 13:33 UTC Modified: 2003-02-19 17:55 UTC
From: tom dot weber at web dot lu Assigned:
Status: Closed Package: Misbehaving function
PHP Version: 3.0.6 OS: linux
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: tom dot weber at web dot lu
New email:
PHP Version: OS:

 

 [1999-03-14 13:33 UTC] tom dot weber at web dot lu
If You use the STRPOS and you don't find anything it will return FALSE
FALSE has the Value 0.
Now, If You are looking for a sub-string and it is located on the beginning
of the String, it will return 0.

You are not able anymore to distringuish if it is in the string at pos 0
or not.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1999-03-14 14:26 UTC] rasmus
FALSE is defined as the empty string "" which strpos() will return when a match is not found.  If a match is found in the first position it will return 0.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sat Jul 12 10:01:33 2025 UTC