array_intersect_key

Supported Versions: PHP 5 >= 5.1.0, PHP 7, PHP 8
Computes the intersection of arrays using keys for comparison
<?php array_intersect_key(array $array, array ...$arrays): array
<?php             $test = $event && $params[0]($event['name'], $event['params']);

        } else {

            $test = (bool) collect(data_get($this->effects, 'dispatches'))->first(function ($item) use ($value, $params) {

                $commonParams = array_intersect_key($item['params'], $params);



                ksort($commonParams);

                ksort($params);
<?php     static function setParametersToMatchingProperties($component, $params)

    {


        collect(array_intersect_key($params, Utils::getPublicPropertiesDefinedOnSubclass($component)))

            ->each(function ($value, $property) use ($component) {

                $component->{$property} = $value;

            });
<?php     public static function only($array, $keys)

    {

        return array_intersect_key($array, array_flip((array) $keys));

    }
<?php     public function intersectByKeys($items)

    {

        return new static(array_intersect_key(

            $this->items, $this->getArrayableItems($items)

        ));

    }
<?php     protected function fillableFromArray(array $attributes)

    {

        if (count($this->getFillable()) > 0 && ! static::$unguarded) {

            return array_intersect_key($attributes, array_flip($this->getFillable()));

        }



        return $attributes;
<?php     protected function getArrayableItems(array $values)

    {

        if (count($this->getVisible()) > 0) {

            $values = array_intersect_key($values, array_flip($this->getVisible()));

        }



        if (count($this->getHidden()) > 0) {
<?php     public function only($keys)

    {

        return array_intersect_key($this->data, array_flip($keys));

    }
<?php     public function onlyHidden($keys)

    {

        return array_intersect_key($this->hidden, array_flip($keys));

    }
<?php         $fields = array_fill_keys($matches[0], null);



        $route->setBindingFields(array_replace(

            $fields, array_intersect_key($bindingFields, $fields)

        ));

    }
<?php             return [];

        }



        $parameters = array_intersect_key($matches, array_flip($parameterNames));



        return array_filter($parameters, function ($value) {

            return is_string($value) && strlen($value) > 0;
<?php     protected static function pathsForProviderAndGroup($provider, $group)

    {

        if (! empty(static::$publishes[$provider]) && ! empty(static::$publishGroups[$group])) {

            return array_intersect_key(static::$publishes[$provider], static::$publishGroups[$group]);

        }



        return [];
<?php             $this->passes();

        }



        $invalid = array_intersect_key(

            $this->data, $this->attributesThatHaveMessages()

        );



        $result = [];
<?php         $dataKeys = array_keys($data);



        if (empty(array_diff($parameters, $dataKeys))) {

            return new static(...array_intersect_key($data, array_flip($parameters)));

        }



        return Container::getInstance()->make(static::class, $data);
<?php         $platformOptions1 = $column1->getPlatformOptions();

        $platformOptions2 = $column2->getPlatformOptions();



        foreach (array_keys(array_intersect_key($platformOptions1, $platformOptions2)) as $key) {

            if ($properties1[$key] === $properties2[$key]) {

                continue;

            }
<?php                     ),

                ],

            ],

            array_intersect_key($params, ['primary' => null, 'replica' => null])

        );

    }