I want to know how to array_intersect for object array.
The correct solution would be:
array_uintersect($arr1, $arr2, function ($a1, $a2) { return $a1 != $a2; });
Note the != in the callback function as opposed to the answer from @Artefacto. Based on the documentation of array_uintersect, the callback function has to return 0 (false) if array items are equal.