Comments (6)
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?);
from array_column.
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:
- php/php-src#331
- http://grokbase.com/t/php/php-internals/134pjar0re/functionality-updates-to-array-column
from array_column.
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?
from array_column.
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.
from array_column.
I think it makes sense to maintain a separate version for all PHP versions if the core changes. However it is also harder.
from array_column.
Is this the functionality you're asking for?
https://bugs.php.net/bug.php?id=66435
from array_column.
Related Issues (8)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from array_column.