Skip to content

Conversation

@medmahmoudhdaya
Copy link

This PR updates the Arr::dot() method to convert empty arrays to null when flattening multi-dimensional arrays. The tests have been updated to reflect this behavior.

Before

Arr::dot(['foo' => []]);
// ['foo' => []]

After

Arr::dot(['foo' => []]);
// ['foo' => null]

Converting empty arrays to null makes the output more consistent for serialization, database storage, and logging.

Fixes #57305

@cosmastech
Copy link
Contributor

See Taylor's comment here: #57307 (comment)

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Arr::dot() doesn't flatten empty arrays

2 participants