`$domains` is usually small array (several items) and `$catalogues` is often quite big. So the `for`-loop is used here (instead of `array_flip` + `foreach`-loop) in only matter of performance.