Two values from key => value pairs are considered equal only if
(string) $elem1 === (string) $elem2
. In other words a strict check takes place so the string representations must be the same.
http://php.net/manual/en/function.array-diff-assoc.php
The (string)
value of any array is "Array"
. Thus, your call to array_diff_assoc
is effectively comparing these two things:
Array ( [0] => "Array" [1] => "Array" )
Array ( [0] => "Array" )
Since the thing that is different between those two is the [1]
key/value pair from the first array, you get that back ([1] => Array( [11] => common set )
).