public static function array_remove_assoc_recursive(&$array1, $array2)
    {
        foreach ($array2 as $key => $value) {
            if (!array_key_exists($key, $array1)) {
                return $array1;
            } elseif (is_array($value)) {
                self::array_remove_assoc_recursive($array1[$key], $value);
                if (0 === count($array1[$key])) {
                    unset($array1[$key]);
                }
            } else {
                unset($array1[$key]);
            }
        }
    }