Doc #52509 [Asn->Csd]: strcspn() docs are not clear
| From: | philip@php.net | Date: | Tue, 10 Aug 2010 17:38:29 +0000 |
| Subject: | Doc #52509 [Asn->Csd]: strcspn() docs are not clear | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-4835@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=52509&edit=1
ID: 52509
Updated by: philip@php.net
Reported by: mr dot joebert at gmail dot com
Summary: strcspn() docs are not clear
-Status: Assigned
+Status: Closed
Type: Documentation Problem
Package: Documentation problem
PHP Version: Irrelevant
Assigned To: philip
Block user comment: N
New Comment:
This is fixed in SVN (and will show up online this upcoming Friday),
thanks for
the bug report :)
Previous Comments:
------------------------------------------------------------------------
[2010-08-10 19:37:40] philip@php.net
Automatic comment from SVN on behalf of philip
Revision: http://svn.php.net/viewvc/?view=revision&revision=302077
Log: Added example to clarify behavior. Closes PHP bug #52509
------------------------------------------------------------------------
[2010-08-01 21:14:39] mr dot joebert at gmail dot com
Description:
------------
The description for the strcspn function is confusing.
"Returns the length of the initial segment of str1 which does not
contain any of the characters in str2."
This seems to indicate that the function looks for a string of
unexpected characters and returns the length of that string. When what
really happens, is that the function will either return zero, or, if the
string starts with unexpected characters, return the length of that.
Behavior I would expect from the description,
strcspn('abcd', 'abc') == 1
strcspn('dabc', 'abc') == 1
What really happens
strcspn('abcd', 'abc') == 0
strcspn('dabc', 'abc') == 1
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=52509&edit=1