On 2012-06-25 04:19, Ralph Schindler wrote:
The term 'column' makes a lot of sense for PDO working with database
columns, but there is no concept of a 'column' in the array structure or
PHP as a whole, outside of database related functions.

In the case of this addition, I do indeed like array_pluck as well, as
column feel like an overloaded term.

While casting around for other array_* names, I remembered that array_keys() can take a second (and third) argument. With it, the function returns all keys indexing a given value.

What we're discussing here is basically a dual to that: return all values indexed by a given key.[*]

If the duality is continued, then what we get is

array_values(array $input[, mixed $key])

(A third $strict argument would probably do more harm than good: the key can only be an integer or a non-numeric string, and using the same type coercion rules would smooth out differences in the $key argument.)

[*] Yes, I know the symmetry isn't perfect, and why; the question is whether the difference is more likely to result in "Well, duh!" or "WTF?!".

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to