What's going on with array_unique() function?
| From: | Dallas Thunder | Date: | Wed, 11 Sep 2002 04:19:17 +0000 |
| Subject: | What's going on with array_unique() function? | ||
| Groups: | php.doc | ||
| Request: | Send a blank email to phpdoc+get-969348587@lists.php.net to get a copy of this message | ||
In reference/array/functions/array-unique.xml file there's an example:
$input = array (4,"4","3",4,3,"3");
$result = array_unique ($input);
var_dump($result);
The printout of the program above will be (PHP 4.0.6):
array(2) {
[3]=>
int(4)
[4]=>
int(3)
}
But in my Linux system, both PHP 4.0.6 and PHP 4.3.0-dev print the following
result:
array(2) {
[0]=>
int(4)
[2]=>
string(1) "3"
}
And in PHP 4.2.3-dev under Windows it print out:
array(2) {
[1]=>
string(1) "4"
[5]=>
string(1) "3"
}
This really confused me. What's going on here? Thanks in advance.