|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #54240 mb_ereg_search_getpos() counts umlauts twice
Submitted: 2011-03-13 08:33 UTC Modified: 2012-06-20 23:16 UTC
From: phpbug at ymail dot com Assigned:
Status: Not a bug Package: Regexps related
PHP Version: 5.2.17 OS:
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:
41 + 42 = ?
Subscribe to this entry?

 [2011-03-13 08:33 UTC] phpbug at ymail dot com
mb_ereg_search_getpos() seems to count German umlauts twice. See test script.

Test script:

$test1 = "ab";
$test2 = "ääb";
$test3 = "äääb";

mb_ereg_search_init($test1, "b");
echo "Test1: " . mb_ereg_search_getpos(); // Result: 2

mb_ereg_search_init($test2, "b");
echo "Test2: " . mb_ereg_search_getpos(); // Result: 5 (should be "3")

mb_ereg_search_init($test3, "b");
echo "Test3: " . mb_ereg_search_getpos(); // Result: 7 (should be "4")


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2012-06-20 23:16 UTC]
-Status: Open +Status: Not a bug
 [2012-06-20 23:16 UTC]
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at and the instructions on how to report
a bug at

As mentioned in the documentation:
"The position is represented by bytes from the head of string."
and as such this is the expected behavior.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Feb 29 16:01:38 2024 UTC