public static function extend($destination, $sources)
    {
        $sources = array_slice(func_get_args(), 1);

        static::each($sources, function ($source) use (& $destination) {
            static::each($source, function ($value, $name) use (& $destination) {
                static::set($destination, $name, $value);
            });
        });

        return $destination;
    }
public static function extend($destination, $sources)
    {
        $sources = array_slice(func_get_args(), 1);

        static::each($sources, function ($source) use (& $destination) {
            static::each($source, function ($value, $name) use (& $destination) {
                static::set($destination, $name, $value);
            });
        });

        return $destination;
    }
public static function extend ( $ destination , $ sources ) { $ sources = array_slice ( func_get_args ( ) , 1 ) ; static :: each ( $ sources , function ( $ source ) use ( & $ destination ) { static :: each ( $ source , function ( $ value , $ name ) use ( & $ destination ) { static :: set ( $ destination , $ name , $ value ) ; } ) ; } ) ; return $ destination ; }
Copy all of the properties in the source objects over to the destination object, and return the destination
object. It's in-order, so the last source will override properties of the same name in previous arguments.

@category Object Functions

@param object,array $destination the destination object
@param object,array $sources multiple, the source objects

@return object,array
Copy all of the properties in the source objects over to the destination object and return the destination object . It s in - order so the last source will override properties of the same name in previous arguments .