#42710 [NEW]: Strspn() documentation needs more explanation for start and length arguments

From: Date: Wed, 19 Sep 2007 12:36:42 +0000
Subject: #42710 [NEW]: Strspn() documentation needs more explanation for start and length arguments
Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-22@lists.php.net to get a copy of this message
From: nikhil dot gupta at in dot ibm dot com Operating system: Linux, Win32-xp PHP version: Irrelevant PHP Bug Type: Documentation problem Bug description: Strspn() documentation needs more explanation for start and length arguments Description: ------------ The documentation for strspn() seems to be incomplete. It donot explains the function behaviour with negative values of start and len argument.Without looking at the PHP source code one cannot confirm the behaviour of the function for negative start and len values. Reproduce code: --------------- Following can be added to the documentation: 1. When fourth argument(len) is not passed a)if $start<0 and $start >= -(length of $str) then start=start+length of $str b)if $start<0 and start < -(length of $str A) c)By default, $len=length of $str 2. When all four arguments are passed to the function: a)if $start<0 and $start >= -(length of $str) then start=start+length of $str b)if $start<0 and start < -(length of $str A) c)if $len<0 and $len >= -(length of $str - $start) then len=len+(length of $str - $start) d)if $len<0 and $len < -(length of $str - $start) then len=0. -- Edit bug report at http://bugs.php.net/?id=42710&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=42710&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=42710&r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=42710&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=42710&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=42710&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=42710&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=42710&r=needscript Try newer version: http://bugs.php.net/fix.php?id=42710&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=42710&r=support Expected behavior: http://bugs.php.net/fix.php?id=42710&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=42710&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=42710&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=42710&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=42710&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=42710&r=dst IIS Stability: http://bugs.php.net/fix.php?id=42710&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=42710&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=42710&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=42710&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=42710&r=mysqlcfg

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