|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2003-07-27 10:03 UTC] iliaa@php.net
[2003-07-27 13:50 UTC] niklas at zim dot goe dot net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Dec 02 00:00:01 2025 UTC |
Description: ------------ The function array_intersect_assoc compares keys AND values. According to the documentation only the keys should be considered. The documentation says: "Note that the keys are used in the comparison unlike in array_intersect()." If this is the volitional behavior you should point that out in the documentation ("... that the keys are used too ..."). Reproduce code: --------------- $array1 = array ("a" => "green"); $array2 = array ("a" => "greenToo"); print_r(array_intersect_assoc ($array1, $array2)); Expected result: ---------------- Array( [a] => "green" ) Actual result: -------------- Array()