PHP 4.0 Bug #9102: a possible bug in count_chars
| From: | artymiak at safenet dot pl | Date: | Sun, 04 Feb 2001 19:53:10 +0000 |
| Subject: | PHP 4.0 Bug #9102: a possible bug in count_chars | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-45741@lists.php.net to get a copy of this message | ||
From: artymiak@safenet.pl
Operating system: OpenBSD 2.7
PHP version: 4.0.3pl1
PHP Bug Type: Strings related
Bug description: a possible bug in count_chars
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++;
}
--
Edit Bug report at: http://bugs.php.net/?id=9102&edit=1