array_intersect_assoc
laravel/framework
Supported Versions: PHP 4 >= 4.3.0, PHP 5, PHP 7, PHP 8
Computes the intersection of arrays with additional index check
array_intersect_assoc
(array
$array
, array ...
$arrays
): array
$random
=
Arr
::
random
([
'one'
=>
'foo'
,
'two'
=>
'bar'
,
'three'
=>
'baz'
],
2
,
true
);
$this
->
assertIsArray
(
$random
);
$this
->
assertCount
(
2
,
$random
);
$this
->
assertCount
(
2
,
array_intersect_assoc
([
'one'
=>
'foo'
,
'two'
=>
'bar'
,
'three'
=>
'baz'
],
$random
));
}
public function
testRandomOnEmptyArray
()
tests/Support/SupportArrTest.php