Merging two complex objects in PHP

I have two data objects converted from JSON. both are quite deeply complex and I’d like to merge them in a similar fashion to how jQuery would merge two objects using extend.

example

JSON 1:

{
….