Sort arrays before comparing params

When using the -> syntax for assigning relationships,
the order in which the values are assigned to parameters
can be non-deterministic.

This patch assumes that array order never matters (which
may be an erraneous assumption) and thus sorts arrays before doing
the comparison.