Doc #62458 [Opn->Csd]: unclear/incomplete about return value - mb_ereg_pos

From: Date: Mon, 02 Jul 2012 01:31:49 +0000
Subject: Doc #62458 [Opn->Csd]: unclear/incomplete about return value - mb_ereg_pos
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-8527@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=62458&edit=1

 ID:                 62458
 Updated by:         aharvey@php.net
 Reported by:        matteosistisette at gmail dot com
 Summary:            unclear/incomplete about return value - mb_ereg_pos
-Status:             Open
+Status:             Closed
 Type:               Documentation Problem
 Package:            Documentation problem
 PHP Version:        Irrelevant
-Assigned To:        
+Assigned To:        aharvey
 Block user comment: N
 Private report:     N

 New Comment:

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.




Previous Comments:
------------------------------------------------------------------------
[2012-07-02 01:31:36] 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-01 11:57:53] 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.



------------------------------------------------------------------------



-- 
Edit this bug report at https://bugs.php.net/bug.php?id=62458&edit=1


Thread (2 messages)

« previous php.doc.bugs (#8527) next »