I want to know how to array_intersect for object array.
The correct way to check whether two objects are equal is to use ==. Therefore:
==
array_uintersect($arr1, $arr2, function ($a1, $a2) { return $a1 == $a2; });