|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2002-01-02 13:20 UTC] pgerzson at freestart dot hu
[2002-01-09 12:18 UTC] pgerzson at freestart dot hu
[2002-01-16 17:43 UTC] venaas@php.net
[2002-01-16 18:41 UTC] pgerzson at freestart dot hu
[2002-06-18 16:36 UTC] venaas@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 19 12:00:02 2025 UTC |
The manual (recent version from cvs) states that : " array_unique() will keep the first key encountered for every value, and ignore all following keys. " I've tested the two examples in this page and I've found this statement is not true. <?php $input = array (4,"4","3",4,3,"3"); $result = array_unique ($input); var_dump($result); ?> output: /* PHP 4.0.6 Win'98 PWS */ array(2) { [3]=> int(4) [4]=> int(3) } but the manual says it should print: array(2) { [0]=> int(4) [1]=> string(1) "3" } As you can recognize the latest keys are preserved for both value 4 and 3.