php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #33189 error in definition of strripos
Submitted: 2005-05-30 19:51 UTC Modified: 2005-05-30 20:05 UTC
From: alex at idoia dot com Assigned:
Status: Closed Package: Documentation problem
PHP Version: Irrelevant OS: debian 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: alex at idoia dot com
New email:
PHP Version: OS:

 

 [2005-05-30 19:51 UTC] alex at idoia dot com
Description:
------------
the description says:
"offset may be specified to begin searching an arbitrary 
number of characters into the string. Negative values 
will stop searching at an arbitrary point prior to the 
end of the string."

And I think the right definition is:
offset may be specified to begin searching an arbitrary 
number of characters into the string. Negative values 
will START searching at an arbitrary point prior to the 
end of the string.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-05-30 19:58 UTC] aidan@php.net
Hi Alex,

Actually that's not quite correct either.

Negative offset values mean the end of string is moved to the left by the magnitude of the specified value plus one.

E.g. strripos('abcdef', 'b', -4) will search the string 'abc' for 'b'.

I've updated the manual to be a little more explicit.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Nov 20 02:00:01 2025 UTC