Created
December 18, 2014 09:41
-
-
Save lutzissler/345a8d4a16f25f35fd9a to your computer and use it in GitHub Desktop.
Extend $object1 with the properties of $object2 and return the resulting object.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function extend($object1, $object2) { | |
return (object)array_merge((array)$object1, (array)$object2); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment