note 89721 added to function.array-count-values
| From: | Anonymous at osu1 dot php dot net | Date: | Fri, 20 Mar 2009 10:03:04 +0000 |
| Subject: | note 89721 added to function.array-count-values | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-152188@lists.php.net to get a copy of this message | ||
Regarding psbauman's post.
Actually, if I try that code the results I get for $id_counts as $id_numbers are exactly what I
would expect:
$id_count[375] = 1;
$id_count[5349] = 2;
and
$id_numbers[0] = 375;
$id_numbers[1] = 5349;
$id_numbers[2] = 5349;
Since integer literals with leading 0 digits are parsed as octal.
If I specify the seven-digit numbers as strings:
$id_numbers[0] = '0056789';
$id_numbers[1] = '0012345';
$id_numbers[2] = '0012345';
The keys in $id_count are '0056789' and '0012345' and the values are unchanged -
again, exactly as I'd expect.
----
Server IP: 202.89.58.1
Probable Submitter: 114.134.161.9
----
Manual Page -- http://www.php.net/manual/en/function.array-count-values.php
Edit -- https://master.php.net/note/edit/89721
Del: integrated -- https://master.php.net/note/delete/89721/integrated
Del: useless -- https://master.php.net/note/delete/89721/useless
Del: bad code -- https://master.php.net/note/delete/89721/bad+code
Del: spam -- https://master.php.net/note/delete/89721/spam
Del: non-english -- https://master.php.net/note/delete/89721/non-english
Del: in docs -- https://master.php.net/note/delete/89721/in+docs
Del: other reasons-- https://master.php.net/note/delete/89721
Reject -- https://master.php.net/note/reject/89721
Search -- https://master.php.net/manage/user-notes.php