ID: 24367
Updated by: [EMAIL PROTECTED]
Reported By: php at projectjj dot com
-Status: Open
+Status: Bogus
Bug Type: Strings related
Operating System: Windows 2k SP3
PHP Version: 4.3.2
New Comment:
It works exactly the same as the libc counterpart,
that's the expected way. Not bug.
Previous Comments:
------------------------------------------------------------------------
[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