$attr can also be an array, i.e. string|string[]
we can change it to expect an array only later.