Skip to content

Conversation

@jimwins
Copy link
Member

@jimwins jimwins commented Sep 29, 2024

Based on discussion at PR #1470

$replacements2 = [ 'citrus' => [ 'kumquat', 'citron' ], 'pome' => [ 'loquat' ] ];
$basket = array_replace($base, $replacements, $replacements2);
print_r($basket);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I usually prefer var_dump() then print_r() as it is whitespace sensitive in very awkward places :/

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just copied what the first example was doing. I've changed them both to var_dump().

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did leave alone the array(...) syntax on the first example even though I used [ ... ] in the second.

Copy link
Member

@Girgias Girgias left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@jimwins jimwins merged commit 5cc10e8 into php:master Oct 1, 2024
@jimwins jimwins deleted the pr-1470-alt branch October 1, 2024 18:52
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.

2 participants