|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2007-11-21 15:59 UTC] vrana@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 08 15:00:02 2026 UTC |
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.