|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #9102 a possible bug in count_chars
Submitted: 2001-02-04 14:53 UTC Modified: 2001-02-15 08:57 UTC
From: artymiak at safenet dot pl Assigned:
Status: Closed Package: Strings related
PHP Version: 4.0.3pl1 OS: OpenBSD 2.7
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
46 - 20 = ?
Subscribe to this entry?

 [2001-02-04 14:53 UTC] artymiak at safenet dot pl
The following code stops at 254, whereas the documentation says count_chars ought to generate an array of 256 element.

var_dump($b) shows an array with 255 elements instead of 256.

$a = "a quick brown fox jumps over the lazy dog";
$b = count_chars($a, 0);
$m = 0;
foreach ($b as $n) {
 echo "Code $m was found $n times<br>";


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2001-02-15 08:57 UTC]
fixed in CVS
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Tue Sep 28 08:03:36 2021 UTC