Doc #62458 [NEW]: unclear/incomplete about return value - mb_ereg_pos
| From: | matteosistisette at gmail dot com | Date: | Sun, 01 Jul 2012 11:57:53 +0000 |
| Subject: | Doc #62458 [NEW]: unclear/incomplete about return value - mb_ereg_pos | ||
| Groups: | php.doc.bugs | ||
| Request: | Send a blank email to doc-bugs+get-8525@lists.php.net to get a copy of this message | ||
From: matteosistisette at gmail dot com
Operating system:
PHP version: Irrelevant
Package: Documentation problem
Bug Type: Documentation Problem
Bug description:unclear/incomplete about return value - mb_ereg_pos
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 bug report at https://bugs.php.net/bug.php?id=62458&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=62458&r=trysnapshot54
Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=62458&r=trysnapshot53
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=62458&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=62458&r=fixed
Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=62458&r=needdocs
Fixed in release: https://bugs.php.net/fix.php?id=62458&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=62458&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=62458&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=62458&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=62458&r=support
Expected behavior: https://bugs.php.net/fix.php?id=62458&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=62458&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=62458&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=62458&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=62458&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=62458&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=62458&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=62458&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=62458&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=62458&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=62458&r=mysqlcfg