original_string: public static function arrayMergeRecursiveUnique($array1, $array2)
      {
          if (empty($array1)) {
              // Optimize the base case
              return $array2;
          }
  
          foreach ($array2 as $key => $value) {
              if (is_array($value) && isset($array1[$key]) && is_array($array1[$key])) {
                  $value = static::arrayMergeRecursiveUnique($array1[$key], $value);
              }
              $array1[$key] = $value;
          }
  
          return $array1;
      }
code: public static function arrayMergeRecursiveUnique($array1, $array2)
      {
          if (empty($array1)) {
              // Optimize the base case
              return $array2;
          }
  
          foreach ($array2 as $key => $value) {
              if (is_array($value) && isset($array1[$key]) && is_array($array1[$key])) {
                  $value = static::arrayMergeRecursiveUnique($array1[$key], $value);
              }
              $array1[$key] = $value;
          }
  
          return $array1;
      }
code_tokens: public static function arrayMergeRecursiveUnique ( $ array1 , $ array2 ) { if ( empty ( $ array1 ) ) { // Optimize the base case return $ array2 ; } foreach ( $ array2 as $ key => $ value ) { if ( is_array ( $ value ) && isset ( $ array1 [ $ key ] ) && is_array ( $ array1 [ $ key ] ) ) { $ value = static :: arrayMergeRecursiveUnique ( $ array1 [ $ key ] , $ value ) ; } $ array1 [ $ key ] = $ value ; } return $ array1 ; }
docstring: Recursive Merge with uniqueness
  
  @param array $array1
  @param array $array2
  @return array
docstring_tokens: Recursive Merge with uniqueness