ID: 24367 User updated by: php at projectjj dot com Reported By: php at projectjj dot com Status: Bogus Bug Type: Strings related Operating System: Windows 2k SP3 PHP Version: 4.3.2 New Comment:
I did expect it to be case-sensitive, but by your description that means it will only search from the start of the string. A matching substring does not count. >From the manual: "strspn -- Find length of initial segment matching mask" The use of 'segment' made me think otherwise. Perhaps a re-wording is needed... Previous Comments: ------------------------------------------------------------------------ [2003-06-27 17:45:55] [EMAIL PROTECTED] It works exactly the same as the libc counterpart, that's the expected way. Not bug. ------------------------------------------------------------------------ [2003-06-27 17:36:06] marcot at tabini dot ca No, because strspn is case-sensitive. In the first instance, there is no initial string that contains characters from your second parameter (the string begins with 'r', which doesn't match any of the characters in 'R'). In the second case, the first character of 'Rrc' contains characters from 'R', and therefore the function returns 1. ------------------------------------------------------------------------ [2003-06-27 15:21:30] php at projectjj dot com Description: ------------ echo strspn('rRc', 'R'); // returns 0 echo strspn('Rrc', 'R'); // returns 1 Shouldn't both of these return 1? Reproduce code: --------------- echo strspn('rRc', 'R'); Expected result: ---------------- 1 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=24367&edit=1