-
Notifications
You must be signed in to change notification settings - Fork 79
Return original index #3
Comments
Thanks for the recommendation. I don't disagree with this feature, but it was discussed and decided not to include it in core PHP. Since this library is intended to maintain parity with core, I won't be adding it here, unless it gets added to core. See here for reference: |
IMO the referenced discussion is mostly against the other two features. The first feature could still be merged. Only thing I would modify: The third param should be true to use the original index, so you have the opportunity to get a reindexed array. Do you see any chance of it? |
I'll reopen this and give it some thought. If I do it, I'll need to get it accepted into core first, and then add it here, but it will put users in an odd state, since the functionality won't exist in 5.5, while it exists in this library, which they can't use if they're using 5.5. |
I think it makes sense to maintain a separate version for all PHP versions if the core changes. However it is also harder. |
Is this the functionality you're asking for? |
I am unable to fully understand that request. However, if I understand it well then it does not make sense. What I would like is the following: $arr = [
'key' => [
'foo' => 'bar',
],
];
// returns ['key' => 'bar']
array_column($arr, 'foo', true?); |
It would be great if the function could return the original index of the row.
Example:
I know it only mimics the core function, but still would be a great feature.
The text was updated successfully, but these errors were encountered: