Doc #68076 [NEW]: mb_substr() incorrect documentation for length parameter
| From: | katrina at pixeldesigns dot ca | Date: | Mon, 22 Sep 2014 18:31:56 +0000 |
| Subject: | Doc #68076 [NEW]: mb_substr() incorrect documentation for length parameter | ||
| Groups: | php.doc.bugs | ||
| Request: | Send a blank email to doc-bugs+get-11501@lists.php.net to get a copy of this message | ||
From: katrina at pixeldesigns dot ca
Operating system: Mac OSX
PHP version: Irrelevant
Package: Documentation problem
Bug Type: Documentation Problem
Bug description:mb_substr() incorrect documentation for length parameter
Description:
------------
---
From manual page: http://www.php.net/function.mb-substr
---
Documentation states:
length parameter - If omitted or NULL is passed, extract all characters
to the end of the string. See here:
http://php.net/manual/en/function.mb-substr.php
Ideally omitting NULL would result in a return value of all characters
to the end of the string. However, the next best solution would be to
update the documentation so that it accurately describes the behaviour
of mb_subtr().
I have also noticed that other versions of this page do not contain that
misleading statement, such as on docs.php.net
Test script:
---------------
mb_substr('Hello I am a string', 6, NULL, 'UTF-8');
RETURNS 'I'
mb_substr('Hello I am a string', 6);
RETURNS 'I am a string'
Expected result:
----------------
mb_substr('Hello I am a string', 6, NULL, 'UTF-8');
RETURNS 'I am a string'
Actual result:
--------------
mb_substr('Hello I am a string', 6, NULL, 'UTF-8');
RETURNS 'I'
--
Edit bug report at https://bugs.php.net/bug.php?id=68076&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=68076&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=68076&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=68076&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=68076&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=68076&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=68076&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=68076&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=68076&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=68076&r=support
Expected behavior: https://bugs.php.net/fix.php?id=68076&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=68076&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=68076&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=68076&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=68076&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=68076&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=68076&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=68076&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=68076&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=68076&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=68076&r=mysqlcfg