php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #52931 strripos not overloaded with function overloading enabled
Submitted: 2010-09-27 10:08 UTC Modified: 2010-09-28 01:09 UTC
From: mail at lutz-petzoldt dot de Assigned: felipe (profile)
Status: Closed Package: mbstring related
PHP Version: 5.3.3 OS: Debian Linux 5
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:
MUST BE VALID
Solve the problem:
36 + 38 = ?
Subscribe to this entry?

 
 [2010-09-27 10:08 UTC] mail at lutz-petzoldt dot de
Description:
------------
It seems like strripos isn't overloaded with mb_strripos when function overloading is enabled. Both functions return different values on a haystack that contains multibyte characters, e.g. german umlauts in my case.

Settings in php.ini:

mbstring.func_overload = 7
mbstring.internal_encoding = utf-8

Test script:
---------------
$string = '<body>Umlauttest öüä</body>';

var_dump(strlen($string));
var_dump(mb_strlen($string));

var_dump(strripos($string, '</body>'));
var_dump(mb_strripos($string, '</body>'));


Expected result:
----------------
int(27)
int(27)
int(20)
int(20)


Actual result:
--------------
int(27)
int(27)
int(23)
int(20)


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-09-28 01:09 UTC] felipe@php.net
Automatic comment from SVN on behalf of felipe
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=303805
Log: - Fixed bug #52931 (strripos not overloaded with function overloading enabled)
 [2010-09-28 01:09 UTC] felipe@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: felipe
 [2010-09-28 01:09 UTC] felipe@php.net
This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 19 08:01:29 2024 UTC