Giter VIP home page Giter VIP logo

Comments (3)

adbario avatar adbario commented on June 18, 2024

Hi @KarelWintersky 👋

Depending on your situation, you should use either set() or add():

$dot->set([
    'A.E.X' => 5,
    'A.E.Y' => 6,
    'A.F' => 7
]);
$dot->add([
    'A.E.X' => 5,
    'A.E.Y' => 6,
    'A.F' => 7
]);

There are multiple ways to manipulate the content of the collection; please have a look at the documentation, and the test suite also has great examples.

from php-dot-notation.

KarelWintersky avatar KarelWintersky commented on June 18, 2024

It's not always possible declare collection as:

$dot->set([
    'A.E.X' => 5,
    'A.E.Y' => 6,
    'A.F' => 7
]);

much more often the collection is declared "piece by piece":

$dot->add('A.F', 7);
// later 
$dot->add('A', [ 'E.Y' => 6 ] );
// and so on.. 

from php-dot-notation.

adbario avatar adbario commented on June 18, 2024

It's not always possible declare collection as:

Yes, I totally get what you're saying, but over 150 libraries/apps depend on this package, and your suggestion would be a breaking change. I'll consider this in future major releases if more users would like to have this.

Appreciate your input 👍

from php-dot-notation.

Related Issues (16)

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.