Set the value of a key, only if the key does not exist
@param string $key
@param string $value
@return boolean true if the key was set, false if the key was not set
162845
public function setnx($key, $value)
    {
        $this->init();
        $result = $this->driver->setnx($key, $value);
        return (bool)$result;
    }
298356
public function setnx(string $key, string $value): bool {
		$return_value = false;
		$success      = $this->lock($key, function($handle) use ($value, &$return_value) {
			$old_value = $this->getWithLock($handle);
			if (($old_value === false) && $this->setWithLock($handle, $value, -1)) {
				return $return_value = true;
			}
			else
				return $return_value = false;
		});
		return ($success && $return_value);
	}
227022
public function set($key, $value)
    {
        $this->checkForNonEmptyKey($key);

        $this->getBackEndUser()->uc[self::PHPUNIT_SETTINGS_KEY][$key] = $value;
        $this->getBackEndUser()->writeUC();
    }
387244
public function set($key, $value)
    {
        $hash = $this->key_to_hash($key);
        $this->array[$hash] = $value;
        return $this;
    }
991550
public static function set(string $key, $value) : bool
    {
        $_SESSION[$key] = $value;

        return $_SESSION[$key] === $value;
    }
1151340
public function set($key, $value)
    {
        $allowed = array_diff(array_keys(get_class_vars(get_class($this))), $this->_hidden);
        if (empty($allowed) || !empty($allowed) && in_array($key, $allowed)) {
            if (method_exists($this, 'set' . ucfirst($key))) {
                call_user_func_array([$this, 'set' . ucfirst($key)], [$value]);
            } else {
                $this->{$key} = self::modelize($key, $value);
            }
        }

        return $this;
    }
961836
public function set($key, $value)
    {
        if (is_null($value)) {
            $value = 'NULL';
        } else if (is_bool($value)) {
            $value = $value ? 'TRUE' : 'FALSE';
        }
        
        $this->set[$key] = $value;
        
        return $this;
    }
534151
protected function setKeyValue($key, $value)
    {
        $this->validateKeyValue($key, $value);

        if ($this->isDefault($key, $value) && $this->isSaved($key)) {
            return $this->deleteRecord($key);
        } elseif ($this->isDefault($key, $value)) {
            return;
        } elseif ($this->isSaved($key)) {
            return $this->updateRecord($key, $value);
        }

        return $this->createRecord($key, $value);
    }
121083
public function update(string $key, $value): bool
    {
        if ($this->hasNot($key)) {
            return false;
        }

        $this->set($key, $value);

        return true;
    }
1081980
public function set($key, $value)
    {
        $key = trim($key, '.');
        if (strpos($key, '.') !== false) {
            $array =& $this->_items;
            foreach (explode('.', $key) as $v)
                $array =& $array[$v];
            $array = $value;
        } else {
            $this->_items[$key] = $value;
        }
    }
19913
public function set($key, $value)
    {
        $keys = explode('.', $key);

        $data = &$this->parameters;

        while (count($keys) > 1) {
            $pkey = $keys[0];

            if (!array_key_exists($pkey, $data) || !is_array($data[$pkey])) {
                $data[$pkey] = [];
            }

            $data = &$data[$pkey];
            array_shift($keys);
        }

        $data[$keys[0]] = $value;

        return $this;
    }
333759
public function set($key, $value)
    {
        $position = $this->getPosition($key);
        if (false !== $position) {
            $this->file->update($position, $key, $value);
            $this->rebuildIndex();
        } else {
            $pos = $this->file->insert($key, $value);
            $this->index->set($key, $pos);
        }

        return true;
    }
525308
public function offsetSet($key, $value) {
        if(!$this->offsetExists($key)) {
            $this->table[$key] = new Value($value);
        } else {
            $this->table[$key]->setValue($value);
        }
    }
1252193
public function set($key, $value = null)
    {
        if ($value === null) {
            $this->defaultValues = $key + $this->defaultValues;
        } else {
            $this->defaultValues[$key] = $value;
        }

        return $this;
    }
725731
public static function set($key, $value = false)
    {

        /**
         * Check whether session is set in array or not
         * If array then set all session key-values in foreach loop
         */

        self::setPrefix();

        if (is_array($key) && $value === false) {

            foreach ($key as $name => $value) {
                $_SESSION[self::$_sessionPrefix . $name] = $value;
            }

        } else {
            $_SESSION[self::$_sessionPrefix . $key] = $value;
        }

    }
1081692
public function set($key, $value)
    {
        $method = 'setter' . ucfirst($key);
        if (method_exists($this, $method)) {
            $value = $this->$method($value);
        }
        $this->setRaw($key, $value);
    }
905609
public function set( $key, $value )
	{
		if( $this->has( $key ) )																	//  check if pair is already existing
		{
			if( is_null( $value ) )																	//  given value is NULL, which means: remove this pair
				return $this->remove( $key );														//  remove pair and return result of sub operation
			else if( $this->get( $key ) === $value )												//  value of pair did not change
				return FALSE;																		//  quit and return negative because no change has taken place
		}
		$this->pairs[( !$this->caseSensitive ? strtolower( $key ) : $key )]		= $value;			//  set new value of current pair, case insensitive if needed
		return TRUE;																				//  indicate success
	}