Memcached::incrementByKey

(PECL memcached >= 2.0.0)

Memcached::incrementByKeyIncrementa un valor numérico de un elemento almacenado en un servidor específico

Descripción

public Memcached::incrementByKey(
    string $server_key,
    string $key,
    int $offset = 1,
    int $initial_value = 0,
    int $expiry = 0
): int|false

Memcached::incrementByKey() incrementa un valor numérico de un elemento especificando el incremento mediante el argumento offset. Si el valor del elemento no es numérico, se emitirá un error. Memcached::incrementByKey() establecerá el elemento al valor del argumento initial_value si la clave no existe.

Parámetros

server_key

The key identifying the server to store the value on or retrieve it from. Instead of hashing on the actual key for the item, we hash on the server key when deciding which memcached server to talk to. This allows related items to be grouped together on a single server for efficiency with multi operations.

key

La clave del elemento a incrementar.

offset

El incremento a utilizar sobre el valor del elemento.

initial_value

El valor a establecer si el elemento no existe.

expiry

El tiempo de expiración para la definición del elemento.

Valores devueltos

Devuelve el nuevo valor del elemento en caso de éxito o false si ocurre un error.

Ver también

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top