Re: [PHP-DEV] [proposal + patch] array_pick() function

2012-07-22 Thread Ronald Chmara
Standard hazing: 1. Tests? 2. Docs? Annoying if needed whining: I think "array_pick" and "array_rand" are precisely the kind of function naming that makes PHP infamous. I would suggest that array_rand_key() and array_rand_value(), or array_rand() with an argument to default to key (for BC). Speed

[PHP-DEV] [proposal + patch] array_pick() function

2012-07-22 Thread Andrew Faulds
Hi there, This is a small function, called array_pick(), which takes one argument ($array), an array, and returns the value of a random item. Much of its usefulness stems from the new short array syntax, which lets you do array_pick(["funlogo.png", "coollogo.jpg", "kittens.gif"]);, instead of $a