CakeFest 2024: The Official CakePHP Conference

APCUIterator::__construct

(PECL apcu >= 5.0.0)

APCUIterator::__constructConstruye un objeto iterador APCUIterator

Descripción

public APCUIterator::__construct(
    array|string|null $search = null,
    int $format = APC_ITER_ALL,
    int $chunk_size = 100,
    int $list = APC_LIST_ACTIVE
)

Construye un APCUIterator object.

Parámetros

search

O bien una expresión regular PCRE que coincide con nombres de clave APCu, dada como string. O una array de strings con nombres de claves APCu. O, opcionalmente null para omitir la búsqueda.

format

El formato deseado, tal como está configurado con una o más de las constantes APC_ITER_*.

chunk_size

El tamaño del fragmento. Debe ser un valor mayor que 0. El valor por defecto es 100.

list

El tipo de lista. O bien pasar en APC_LIST_ACTIVE o APC_LIST_DELETED.

Ejemplos

Ejemplo #1 Un ejemplo de APCUIterator::__construct()

<?php
foreach (new APCUIterator('/^counter\./') as $counter) {
echo
"$counter[key]: $counter[value]\n";
apc_dec($counter['key'], $counter['value']);
}
?>

Ver también

add a note

User Contributed Notes

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