array_intersect_assoc

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'], 2true);

        
$this->assertIsArray($random);

        
$this->assertCount(2$random);

        
$this->assertCount(2array_intersect_assoc(['one' => 'foo''two' => 'bar''three' => 'baz'], $random));

    }



    public function 
testRandomOnEmptyArray()