I spotted this trying to add a unique index to role.shortorder in lib/db in HEAD. I get PHP warnings. Similar warnings when you try to add a key.
I think something that is really an array is getting initialised to null, rather than array(), and later the code tries to implode it.
I could not see how to fix it myself after a few minutes, and I don't think it stops me actually creating the index, so just filing it here for now.