php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #42731 strcspn() gives incorrect output with mask as empty string with unicode on
Submitted: 2007-09-21 20:21 UTC Modified: 2007-10-02 11:35 UTC
From: nikhil dot gupta at in dot ibm dot com Assigned:
Status: Closed Package: *Unicode Issues
PHP Version: 6CVS-2007-09-21 (CVS) OS: Linux, Win32-xp
Private report: No CVE-ID: None
 [2007-09-21 20:21 UTC] nikhil dot gupta at in dot ibm dot com
Description:
------------
strcspn() when passed with an empty mask string, returns the length of the input string (first arg) with unicode off on PHP6 whereas returns ZERO with unicode ON which is not correct behaviour.

Reproduce code:
---------------
<?php
   var_dump( strcspn("abcde","") );
?>

Expected result:
----------------
int(5)

Actual result:
--------------
int(0)

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-10-02 11:35 UTC] tony2001@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 16 09:01:28 2024 UTC