|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2007-10-03 15:59 UTC] jani@php.net
[2007-10-03 20:52 UTC] tchunai at ig dot com dot br
[2007-10-05 15:30 UTC] jani@php.net
[2007-10-05 15:31 UTC] jani@php.net
[2008-01-25 02:53 UTC] msaraujo@php.net
[2008-01-25 16:52 UTC] felipe@php.net
[2008-02-14 14:04 UTC] felipe@php.net
[2009-07-01 15:34 UTC] dmitry@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 03:00:02 2025 UTC |
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 )