Is there any built-in PHP way to merge two arrays keeping the keys?

I have two arrays, as demonstrated by keys in the top two dumps here. I would like to merge them together keeping the same keys. But when I use array_merge() it gives me the bottom result, the values are all the same, but the key names are stripped and replaced with a new array starting at index 0. I can write my own function to do the merge, but it just feels like something PHP would have built-in.

submitted by /u/dangoodspeed
[link] [comments]