In jQuery plugins we can pass an anonymous object with properties.
$('selecter').function({property: 'value', property: 'value'})
in the plug in code jquery has a function called extend. what this does is it will take 2 objects as parameters and then overwrite object 1’s properties with the properties from object 2.
Is there a way to do this or something similar in php without the use of arrays?
If your objects just instances of
stdClass– you can do justOtherwise just traverse one object in a loop and assign its properties to another object.