It technically works, but this might generate a warning about shadowing the $cid variable from outside the scope. I'd really prefer if we had unique variable names going into loops, I think it's clearer.