$arr1 is an associative array of anonymus objects:
array
15898 =>
object(stdClass)[8]
public 'date' => int
$arr2 is another associative array with two (or more, it’s not fixed) properties:
array
15898 =>
object(stdClass)[10]
public 'fruits'
public 'drinks'
I can’t find any function for intersect and content fusion when dealing with objects. Basically i’d like to obtain:
array
15898 =>
object(stdClass)[8]
public 'date' => int
public 'fruits'
public 'drinks'
Question is: is this even possible?
If I understand you correctly :-
The above is make use on
get_object_varsto extract all the properties belong to object $a, $b,and merge it to a new array, then do a casting to object
With this, you are able to assign all properties (public) from object $a, $b to $c