note 89721 deleted from function.array-count-values by thiago
| From: | thiago@php.net | Date: | Fri, 20 Mar 2009 12:25:20 +0000 |
| Subject: | note 89721 deleted from function.array-count-values by thiago | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-152194@lists.php.net to get a copy of this message | ||
Note Submitter: Anonymous
----
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.