php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #8034 string function (strcspn)
Submitted: 2000-11-29 11:03 UTC Modified: 2000-12-07 05:49 UTC
From: rottmann at inveris dot de Assigned:
Status: Closed Package: Strings related
PHP Version: 4.0.3pl1 OS: linux (suse)
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: rottmann at inveris dot de
New email:
PHP Version: OS:

 

 [2000-11-29 11:03 UTC] rottmann at inveris dot de
why is "string function" not in the Type of bug: list??

<?
$stringvalue = "xy.,.-,z1";

echo strspn (strtolower ($stringvalue), "abcdefghijklmnopqrstuvwxyz0123456789") . "<br>"; // right
echo strcspn (strtolower ($stringvalue), "abcdefghijklmnopqrstuvwxyz0123456789") . "<br>"; // wrong
?>

the strspn returns the right value...
but strcpsn returns only the right value when the first digit is not in the 2nd string?!?!? or i did misunderstand the
function???

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-12-07 05:49 UTC] stas@php.net
For me strcspn returns 0, which is the correct result, since
strcspn is meant to return length of the segment that does
not contain any of the characters in the second arg. Since
"x" (the first character) is already there, the length is 0.
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Tue Mar 19 19:01:28 2019 UTC