Alias path precedence rule? I just checked that an alias path named, say, any/path can point to N different existing paths. Is there any fixed precedence order as per which one will be processed? Or is it a random order?
Using the user interface, it is not possible to set the same alias pointing to different destinations for the same language.
If a module would execute code similar to the following one, it would be possible to have two records for the same alias.

$path = array(
  'alias' =&gt; 'homepage',
  'source' =&gt; 'node/1',
);
path_save($path);

$path = array(
  'alias' =&gt; 'homepage',
  'source' =&gt; 'node/2',
);
path_save($path);


drupal_lookup_path() contains the following code to retrieve the internal path associated with a path alias from the database. $path_language is the last argument passed to the function; when the function doesn't get that argument, it uses the value of $GLOBALS['language_url']-&gt;language.

    if ($path_language == LANGUAGE_NONE) {
      unset($args[':language']);
      $alias = db_query("SELECT alias FROM {url_alias} WHERE source = :source AND language = :language_none ORDER BY pid DESC", $args)-&gt;fetchField();
    }
    elseif ($path_language &gt; LANGUAGE_NONE) {
      $alias = db_query("SELECT alias FROM {url_alias} WHERE source = :source AND language IN (:language, :language_none) ORDER BY language DESC, pid DESC", $args)-&gt;fetchField();
    }
    else {
      $alias = db_query("SELECT alias FROM {url_alias} WHERE source = :source AND language IN (:language, :language_none) ORDER BY language ASC, pid DESC", $args)-&gt;fetchField();
    }


If $path_language is equal to LANGUAGE_NONE (i.e. you are looking for the internal path associated with the language-independent alias), drupal_lookup_path('source') returns the internal path which is saved in the path_alias table with the higher pid (which normally is the latest created row).
If $path_language is not equal to LANGUAGE_NONE, the database rows are ordered to get the language-specific alias before the language-neutral, and then by pid. Also in this case, the returned internal path would be the last created one.

Suppose url_alias contains the following values.


pid   | source    | alias      | language
4     | node/1    | homepage   | und
5     | node/2    | homepage   | und
8     | node/21   | homepage   | it
9     | node/22   | homepage   | it
10    | node/31   | homepage   | xx-lolspeak
11    | node/32   | homepage   | xx-lolspeak


What I would get from that table is:


drupal_lookup_path('source', 'homepage'): node/2
It returns the last created alias that is language-independent.
drupal_lookup_path('source', 'homepage', 'es'): node/2
There isn't an alias for Spanish, and the function fallback to the language-independent alias. It gets the last created alias.
drupal_lookup_path('source', 'homepage', 'xx-lolspeak'): node/32
It returns the last created alias for Lol Speak.