#45967 [Opn->Csd]: substr() return value is poorly documented

From: Date: Wed, 05 Nov 2008 09:00:12 +0000
Subject: #45967 [Opn->Csd]: substr() return value is poorly documented
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-1335@lists.php.net to get a copy of this message
ID: 45967 Updated by: vrana@php.net Reported By: mike at silverorange dot com -Status: Open +Status: Closed Bug Type: Documentation problem Operating System: Irrelevant PHP Version: Irrelevant 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: ------------------------------------------------------------------------ [2008-09-02 03:07:24] mike at silverorange dot com Description: ------------ Neither the documentation for $start nor the return values section mention that the function may return FALSE. The documentation for $length does mention returning FALSE. Since $length is an optional parameter and doesn't really affect whether or not the function returns FALSE, it is not an intuitive place for the documentation I suggest: 1.) Moving the following line from the $length parameter documentation to the $start parameter documentation: "If $string is less than or equal to $start characters long, FALSE will be returned." 2.) Altering the return documentation to read: "Returns the extracted part of string. If $string is less than or equal to $start characters long, FALSE will be returned." See also http://bugs.php.net/bug.php?id=20695&edit=2 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=45967&edit=1

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