@@ -70,6 +70,7 @@ Here, you can quickly get started by becoming familiar with each and every metho
7070* Computations
7171 * [ sum] ( #sumarray-arrays-array )
7272 * [ diffObjects] ( #diffobjectsarray-array1-array-array2-array-arrays-array )
73+ * [ intersectObjects] ( #intersectobjectsarray-array1-array-array2-array-arrays-array )
7374* Flattening
7475 * [ flatten] ( #flattenarray-array-int-depth--null-bool-assoc--false-array )
7576 * [ flattenSingle] ( #flattensinglearray-array-array )
@@ -611,7 +612,7 @@ Arr::sum([null, '', false], ['1', true, 'test']) -> [1, 1, 0]
611612```
612613
613614### ` diffObjects(array $array1, array $array2, array ...$arrays): array `
614- Differentiate two or more arrays of objects
615+ Compute difference between two or more arrays of objects
615616
616617``` php
617618$object1 = new \stdClass();
@@ -625,6 +626,21 @@ Arr::diffObjects([$object3, $object1, $object2], [$object3], [$object1, $object2
625626Arr::diffObjects([$object1], [$object3], [$object2], []) -> [$object1]
626627```
627628
629+ ### ` intersectObjects(array $array1, array $array2, array ...$arrays): array `
630+ Compute intersection between two or more arrays of objects
631+
632+ ``` php
633+ $object1 = new \stdClass();
634+ $object2 = new \stdClass();
635+ $object3 = new \stdClass();
636+
637+ Arr::intersectObjects([$object3, $object1, $object2], [$object3, $object2], [$object2]) -> [2 => $object2]
638+
639+ Arr::intersectObjects([$object3, $object1, $object2], [$object3], [$object1, $object2]) -> []
640+
641+ Arr::intersectObjects([$object1, $object2, $object3, $object1], [$object1, $object2]) -> [$object1, $object2, 3 => $object1]
642+ ```
643+
628644## Flattening
629645
630646### ` flatten(array $array, ?int $depth = null, bool $assoc = false): array `
0 commit comments