Giter VIP home page Giter VIP logo

Comments (6)

sagikazarmark avatar sagikazarmark commented on July 24, 2024 1

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.

ramsey avatar ramsey commented on July 24, 2024

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:

from array_column.

sagikazarmark avatar sagikazarmark commented on July 24, 2024

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.

ramsey avatar ramsey commented on July 24, 2024

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.

sagikazarmark avatar sagikazarmark commented on July 24, 2024

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.

ramsey avatar ramsey commented on July 24, 2024

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 photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.