note 89342 added to function.array-count-values
| From: | mark-dynom!nl at osu1 dot php dot net | Date: | Wed, 04 Mar 2009 08:07:16 +0000 |
| Subject: | note 89342 added to function.array-count-values | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-151434@lists.php.net to get a copy of this message | ||
@psbauman
This is incorrect (on 5.2.8), since:
<?php
$a = array("005","005", "006");
$b = array_count_values($a);
var_dump($a, $b);
?>
yields:
array(4) {
[0]=>string(3) "005"
[1]=>string(3) "005"
[2]=>string(3) "006"
}
array(3) {
["005"]=>int(2)
["006"]=>int(1)
}
Without quotes the leading zeros dissapear. However this has nothing to do with
array_count_values().
<?php
echo 001;
// 1
?>
----
Server IP: 89.248.170.61
Probable Submitter: 194.171.184.11
----
Manual Page -- http://www.php.net/manual/en/function.array-count-values.php
Edit -- https://master.php.net/note/edit/89342
Del: integrated -- https://master.php.net/note/delete/89342/integrated
Del: useless -- https://master.php.net/note/delete/89342/useless
Del: bad code -- https://master.php.net/note/delete/89342/bad+code
Del: spam -- https://master.php.net/note/delete/89342/spam
Del: non-english -- https://master.php.net/note/delete/89342/non-english
Del: in docs -- https://master.php.net/note/delete/89342/in+docs
Del: other reasons-- https://master.php.net/note/delete/89342
Reject -- https://master.php.net/note/reject/89342
Search -- https://master.php.net/manage/user-notes.php