ID: 12789
Updated by: jeroen
Reported By: [EMAIL PROTECTED]
Old Status: Open
Status: Bogus
Bug Type: Arrays related
Operating System: Cobalt Linux
PHP Version: 4.0.6
New Comment:

Array_unique isn't supposed to handle multi-dimension strings, nor objects.

See also 10658

Previous Comments:
------------------------------------------------------------------------

[2001-08-16 07:45:50] [EMAIL PROTECTED]

array_unique() always returns only 1 result for multi-dimentional arrays

Here is the code:

$temp = Array (
        Array('a', 'b'),
        Array('x', 'y'),
); 
print_r($temp); 
print_r(array_unique($temp)); 

Here is the result in PHP 4.0.4, as it should be, i.e. no array change:

Array
(
    [0] => Array
        (
            [0] => a
            [1] => b
        )

    [1] => Array
        (
            [0] => x
            [1] => y
        )

)
Array
(
    [0] => Array
        (
            [0] => a
            [1] => b
        )

    [1] => Array
        (
            [0] => x
            [1] => y
        )

)

Here is the result in PHP 4.0.6:

Array
(
    [0] => Array
        (
            [0] => a
            [1] => b
        )

    [1] => Array
        (
            [0] => x
            [1] => y
        )

)
Array
(
    [0] => Array
        (
            [0] => a
            [1] => b
        )

)

I have put the code at http://www.99servers.com/develop/test/array_unique.php, you can 
see the results by yourself.

My phpinfo() is located at http://www.99servers.com/develop/test/phpinfo.php, just in 
case you need additional details about my php 4.0.6 configuration.

------------------------------------------------------------------------



Edit this bug report at http://bugs.php.net/?id=12789&edit=1


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to