There is nothing wrong with using $foo[$bar] since $bar can never be a constant, and it's an expression. And in case you use a value from an array as an index for another array, using $post[$user['userid']] is better than $post["$user[userid]"] (since you can't do $post["$user['userid']"]).