php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #62458 unclear/incomplete about return value - mb_ereg_pos
Submitted: 2012-07-01 11:57 UTC Modified: 2012-07-02 01:31 UTC
From: matteosistisette at gmail dot com Assigned: aharvey (profile)
Status: Closed Package: Documentation problem
PHP Version: Irrelevant OS:
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: matteosistisette at gmail dot com
New email:
PHP Version: OS:

 

 [2012-07-01 11:57 UTC] matteosistisette at gmail dot com
Description:
------------
---
From manual page: http://www.php.net/function.mb-ereg-search-pos#refsect1-
function.mb-ereg-search-pos-returnvalues
---
"Return Values

An array including the position of a matched part for a multibyte regular 
expression. The first element of the array will be the beginning of matched 
part, the second element will be length (bytes) of matched part. It returns 
FALSE on error."

While it is clearly specified that the length is returned in bytes, it is not 
clear at all whether the beginning index is returned in bytes or characters, and 
it is of critical importance in multibyte strings. Common sense would suggest 
it's characters, but then one would also expect the length to be return in 
characters while it is return in bytes, so it's hard to guess. And even if it 
was easy to guess, one should _never_ be expected to guess. That's what 
documentation is for.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-07-02 01:31 UTC] aharvey@php.net
Automatic comment from SVN on behalf of aharvey
Revision: http://svn.php.net/viewvc/?view=revision&revision=326414
Log: Fix doc bug #62458 (unclear/incomplete about return value - mb_ereg_pos).
 [2012-07-02 01:31 UTC] aharvey@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.


 [2012-07-02 01:31 UTC] aharvey@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: aharvey
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Tue Oct 06 08:00:02 2026 UTC