LTRIM key start stop
Available since 1.0.0.
Time complexity: O(N) where N is the number of elements to be removed by the operation.
@link http://redis.io/commands/ltrim

@param string $key
@param int $start
@param int $stop
@return bool
772869
public function ltrim($key, $start, $stop) {
        return $this->returnCommand(['LTRIM'], $key, [$key, $start, $stop]);
    }
420187
public function start($start = null, $autoseek = true)
    {
        if (!func_num_args()) {
            return $this->_start;
        }
        $this->_start = (int) $start;

        if ($autoseek) {
            $this->rewind();
        }
        return $this;
    }
6885
public function delete($key)
    {
        $key = $this->_key($key);

        return $this->_Redis->delete($key) > 0;
    }
190521
public function count($key)
    {
        $key = $key instanceof UnitOfTimeInterface ? $this->prefixKey . $key->getKey() : $this->prefixTempKey . $key;

        return (int) $this->getRedisClient()->bitcount($key);
    }
579787
public function start($key)
    {
        $key = strtolower($key);

        $this->benchmarks[$key] = [
            'start_time'    => microtime(true),
            'stop_time'     => 0.0,
            'avg_time'      => 0.0,
            'start_memory'  => memory_get_usage(true),
            'stop_memory'   => 0,
            'avg_memory'    => 0,
            'peak_memory'   => 0,
            'running'       => true
        ];
    }
734559
public function decrby($key, $decrement = 1)
    {
        $this->init();
        return $this->driver->decrby($key, (int)$decrement);
    }
1312915
public function selectKeysByRank(int $start = 0, int $stop = -1, bool $desc = false): array
    {
        //按降序获取
        if ($desc) {
            return $this->handle->zRevRange($this->name, $start, $stop, false);
        }

        //按升序获取
        return $this->handle->zRange($this->name, $start, $stop, false);
    }
639723
def ltrim(self, key, start, stop):
        
        if not isinstance(start, int):
            raise TypeError("start argument must be int")
        if not isinstance(stop, int):
            raise TypeError("stop argument must be int")
        fut = self.execute(b'LTRIM', key, start, stop)
        return wait_ok(fut)
1024825
public function slice( $start, $end ) {
		if ( $start < 0 || ! is_int( $start ) ) {
			throw new InvalidArgumentException( 'Start must be a non-negative integer' );
		}

		if ( $end < 0 || ! is_int( $end ) ) {
			throw new InvalidArgumentException( 'End must be a positive integer' );
		}

		if ( $start > $end ) {
			throw new InvalidArgumentException( 'End must be greater than start' );
		}

		if ( $end > $this->count() + 1 ) {
			throw new InvalidArgumentException( 'End must be less than the count of the items in the Collection' );
		}

		$length = $end - $start + 1;

		return $this->new_from_trusted( array_slice( $this->elements, $start, $length ) );
	}
91894
public function stop($key='default')
  {
    if ( isset($this->measures[$key], $this->measures[$key]['start']) ){
      $this->measures[$key]['num']++;
      $time = $this->measure($key);
      $this->measures[$key]['sum'] += $time;
      unset($this->measures[$key]['start']);
      return $time;
    }
    else{
      die("Missing a start declaration for timer $key");
    }
  }
942226
public function delete($key) {
        $used_key = $this->getUsedKey($key);
        return ($this->redis->delete($used_key) > 0);
    }
359966
private function purgeNonceWord(string $key, array $word, int $stop_nonce, array &$new_nonce_list)
    {
        foreach ($word as $nonce) {
            if ($nonce['time'] >= $stop_nonce) {
                if (!array_key_exists($key, $new_nonce_list)) {
                    $new_nonce_list[$key] = array();
                }
                $new_nonce_list[$key][] = $nonce;
            }
        }
    }
650942
public function lpop($key)
    {
        try {
            return $this->redis->lpop($key);
        } catch (\RedisException $e) {
            die("Error!: " . $e->getMessage() . "<br/>");
        }
    }
747575
public function remove ($key) {
        if (!$this->getConnection ()->getClient ()->zrem ($this->name , $key)) {
            return false;
        }
        $this->_data = null;
        $this->_count = null;
        return true;
    }
658533
public function trim ($start , $stop) {
        if ($this->name === null) {
            throw new InvalidConfigException(get_class ($this) . " requires a name!");
        }
        return $this->getConnection ()->getSlave ()->ltrim ($this->name , $start , $stop) ? true : false;
    }
434439
public function limit($start, $offset = null) {
        $this->_limit = ' LIMIT ' . $start;
        
        if (!is_null($offset)) {
            $this->_limit .= ', ' . $offset;    
        }
        
        return $this;
    }
1217293
def stop(self, key):
        
        self._get_limiter(key).stop()
        self._cleanup_limiter(key)