Is it possible to make the values in $wid become the keys in $possibles, such that we are dealing with associative arrays?
I'm not too clear on how shuffle() works with associative arrays though.
Another way might be to take advantage of pseudorandom numbers, but then shuffle() is automatically seeded, so it may not work.
This solution involves generating a reasonably random seed, and recording it.
Then use this seed in srand().
After using shuffle() on $possibles, use the seed on srand() again.
Then shuffle() $wid.
Since the same seed should produce the same pseudorandom number sequence, the 2 arrays should be shuffled identically.