PHP 8.6.0 Beta 3 is available for testing

Yac::flush

(PECL yac >= 1.0.0)

Yac::flushFlush the cache

説明

public function Yac::flush(): bool

Removes all cached values. Because the cache is shared by every process of the same machine, this empties the cache globally; the key prefix given to Yac::__construct() does not limit what gets flushed.

パラメータ

この関数にはパラメータはありません。

戻り値

Returns true.

例1 Yac::flush() example

<?php
$yac = new Yac();
$yac->set("foo", "bar");

$other = new Yac("app2_");
$other->set("baz", "qux");

// flush empties the whole cache: entries of every instance,
// regardless of the prefix used when they were stored
$yac->flush();

var_dump($yac->get("foo"));   // bool(false)
var_dump($other->get("baz")); // bool(false)
?>

参考

add a note

User Contributed Notes

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