ID: 24367
Comment by: marcot at tabini dot ca
Reported By: php at projectjj dot com
Status: Open
Bug Type: Strings related
Operating System: Windows 2k SP3
PHP Version: 4.3.2
New Comment:
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.
Previous Comments:
------------------------------------------------------------------------
[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