php.net |  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
 [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>";
 $m++;
}

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-02-15 08:57 UTC] thies@php.net
fixed in CVS
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Dec 30 14:01:28 2024 UTC