Doc #68076 [Asn->Csd]: mb_substr() incorrect documentation for length parameter

From: Date: Fri, 28 Jul 2017 14:59:11 +0000
Subject: Doc #68076 [Asn->Csd]: mb_substr() incorrect documentation for length parameter
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-14868@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=68076&edit=1 ID: 68076 Updated by: nikic@php.net Reported by: katrina at pixeldesigns dot ca Summary: mb_substr() incorrect documentation for length parameter -Status: Assigned +Status: Closed Type: Documentation Problem Package: mbstring related Operating System: Mac OSX PHP Version: Irrelevant Assigned To: pasindu Block user comment: N Private report: N New Comment: Looks like the changelog entry has been added at some point, so closing here. Previous Comments: ------------------------------------------------------------------------ [2015-04-28 17:35:11] pasindu@php.net http://3v4l.org/iEirS seems there was a change between 5.4.7 and 5.4.8 that, fixed this issues, probably changelog and a example should be added to show this ------------------------------------------------------------------------ [2014-09-22 18:31:55] katrina at pixeldesigns dot ca 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 this bug report at https://bugs.php.net/bug.php?id=68076&edit=1

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