Skip to content

[Bug]: array_dot_get does a lot of internal recursions #2156

@stloyd

Description

@stloyd

What happened?

I have noticed that array_dot_get() calls repeat a lot of recursions internally to get results, and makes a few unclear calls.

I.e.:

  • there is foreach (\array_keys($arraySlice) as $key) { while in the loop we use value extraction anyway by calls to $arraySlice[$key],
  • there is a check for empty steps inside the above foreach,
  • later there is a call to array_dot_exists($arraySlice[$key], \implode('.', $stepsLeft) just next to array_dot_get() and that call does same check.

How to reproduce?

Simple run the tests ;)

Playground snippet

No response

Data required to reproduce bug locally

None.

Version

0.30

Relevant error output

Copy and paste any relevant error output (no backticks needed).

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions