public static function set(& $object, $key, $value)
    {
        if (static::isArray($object))
            $object[$key] = $value;

        if (static::isObject($object))
            $object->$key = $value;

        return $object;
    }
public static function set(& $object, $key, $value)
    {
        if (static::isArray($object))
            $object[$key] = $value;

        if (static::isObject($object))
            $object->$key = $value;

        return $object;
    }
public static function set ( & $ object , $ key , $ value ) { if ( static :: isArray ( $ object ) ) $ object [ $ key ] = $ value ; if ( static :: isObject ( $ object ) ) $ object -> $ key = $ value ; return $ object ; }
Set object's key value. If object is neither Array nor an Object, the object itself is returned.

@category Object Functions

@param mixed $object reference, the object
@param scalar $key the key
@param mixed $value the value to set

@return mixed
Set object s key value . If object is neither Array nor an Object the object itself is returned .