public static function replaceStrict(array $source, array ...$replace) {

        $replacements = [];

        foreach ($replace as $items) {
            $replacements[] = array_intersect_key($items, $source);
        }

        return array_merge($source, ...$replacements);

    }
public static function replaceStrict(array $source, array ...$replace) {

        $replacements = [];

        foreach ($replace as $items) {
            $replacements[] = array_intersect_key($items, $source);
        }

        return array_merge($source, ...$replacements);

    }
public static function replaceStrict ( array $ source , array ... $ replace ) { $ replacements = [ ] ; foreach ( $ replace as $ items ) { $ replacements [ ] = array_intersect_key ( $ items , $ source ) ; } return array_merge ( $ source , ... $ replacements ) ; }
Replace items only if relative keys are actually defined in source array

@param array $source
@param array $replace
@return array
Replace items only if relative keys are actually defined in source array