|  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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: artymiak at safenet dot pl
New email:
PHP Version: OS:


 [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 06:03:37 2021 UTC