|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #22330 Overloaded strrpos() gives wrong results
Submitted: 2003-02-20 06:28 UTC Modified: 2003-02-20 11:55 UTC
From: david at santinoli dot com Assigned:
Status: Closed Package: mbstring related
PHP Version: 4.3.1 OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
34 + 41 = ?
Subscribe to this entry?

 [2003-02-20 06:28 UTC] david at santinoli dot com

 php_value mbstring.internal_encoding "UTF-8"
 php_value mbstring.func_overload 6

in my php.ini, the overloaded strrpos() gives a wrong result when parsing an UTF-8 string.
For example,


assigns the value 2 to $x, instead of the correct one (1).

My PHP was configured with
./configure  --with-config-file-path=/etc/httpd/conf --with-apxs --with-pgsql 
--with-iconv --enable-mbstring --enable-mbregex

A patch which fixes this bug can be found at



Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2003-02-20 11:55 UTC]
Your patch has just been committed to CVS.
Thanks for the report!


PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Wed Sep 28 00:03:57 2022 UTC