Skip to content

set() and append() generates strange result... #50

Description

@KarelWintersky
$data = new \Dflydev\DotAccessData\Data();

$data->set('b.d', [
    'a' =>  5,
    'b' =>  7
]);
$data->append('b.d', [
    'c' =>  2,
    'd' =>  4
]);

var_dump(
    $data->get('b.d')
);

Result is:

array(3) {
  ["a"]=>   int(5)
  ["b"]=>   int(7)
  [0]=>
  array(2) {
    ["c"]=>     int(2)
    ["d"]=>    int(4)
  }
}

although it is logical to expect the result:

array(3) {
  ["a"]=>   int(5)
  ["b"]=>   int(7)
  ["c"]=>   int(2)
  ["d"]=>   int(4)
  } 
}


Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions