From 7f70616b6a63ff77810b3d73c60189d03b7a5c1c Mon Sep 17 00:00:00 2001 From: Mike Griffiths Date: Tue, 15 Apr 2014 09:31:47 +0000 Subject: [PATCH] Added note about the order of the function parameters. Docs could be miss-interpreted if, this note tries to reinforce expected behaviour and use git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@333318 c90b9560-bf6c-de11-be94-00142212c4b1 --- reference/array/functions/array-diff-assoc.xml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/reference/array/functions/array-diff-assoc.xml b/reference/array/functions/array-diff-assoc.xml index 000e4b1c51..58941ebc64 100644 --- a/reference/array/functions/array-diff-assoc.xml +++ b/reference/array/functions/array-diff-assoc.xml @@ -149,6 +149,23 @@ Array array_diff_assoc($array1[0], $array2[0]);. + + + Ensure you pass arguments in the correct order when comparing similar + arrays with more keys. The new array should be the first in the list, + for example, + + 'blue', 'b' => 'green', 'c' => 'yellow'); +$array2 = array('a' => 'blue', 'b' => 'green'); +$result = array_diff_assoc($array1, $array2); +print_r($result); +?> +]]> + + +