Skip to content

get with string array does not work if any of the strings contain dots. #50

Open
@wescorn

Description

@wescorn

I'm using lodash-php ("lodash-php/lodash-php": "^0.09.0") in a laravel 10 project.
When i using the get method, an error is thrown if any of the keys in the given $path contain dots.

Example:

$myArray = [
  'abc.com' => [
    'foo.net' => [
      'bar' => 'baz'
    ]
  ]
];
$myPath =  ['abc.com', 'foo.net', 'bar'];
\_\get($myArray, $myPath);

//  TypeError  Symfony\Component\PropertyAccess\PropertyAccessor::getValue(): Argument #1 ($objectOrArray) must be of type object|array, null given, called in vendor\lodash-php\lodash-php\src\Util\property.php on line 66.

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