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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
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 08:01:30 2025 UTC