ID:               42838
 Updated by:       [EMAIL PROTECTED]
 Reported By:      tchunai at ig dot com dot br
-Status:           Open
+Status:           Assigned
 Bug Type:         Arrays related
 Operating System: Windows
 PHP Version:      5.2.4
-Assigned To:      
+Assigned To:      andrey
 New Comment:

Assigned to the author of this (and the other similar) function.


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

[2007-10-05 15:30:18] [EMAIL PROTECTED]

Seems to happen with later versions too.

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

[2007-10-03 20:52:47] tchunai at ig dot com dot br

Hi,

I am using 5.2.3.

Best regards

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

[2007-10-03 15:59:26] [EMAIL PROTECTED]

What do you mean with the 'php 5.2.3' in your summary? Do you mean
you're using 5.2.3 and not 5.2.4? Or did it work in 5.2.3?

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

[2007-10-03 14:21:28] tchunai at ig dot com dot br

Description:
------------
array_diff_uassoc:

    If in both array's of comparison will have some key 0 (zero), the
same it is discarded and enclosed as different in the return of
'array_diff_uassoc'.

Reproduce code:
---------------
    function key_compare_func($a, $b)
    {
        if ($a === $b) {
            return 0;
        }
        return ($a > $b)? 1:-1;
    }

    $array1 = array("a" = "green", "b" = "Brown", "c" = "blue", 0 =
"red");
    $array2 = array("a" = "green", "b" = "Brown", "c" = "blue", 0 =
"red");
    
    $result = array_diff_uassoc($array1, $array2, "key_compare_func");
    print_r($result);

Expected result:
----------------
    Array
    (
    )

Actual result:
--------------
    Array
    (
        [b] = brown
        [c] = blue
        [0] = red
    )


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


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

Reply via email to