« Yac::set
音声フォーマットの操作 »

Yac::__set

(PECL yac >= 1.0.0)

Yac::__set — Store a value using property syntax

説明

public function Yac::__set(string $key, mixed $value): mixed

Stores a value in the cache, invoked when writing a property of a Yac instance: $yac->foo = "bar" is equivalent to $yac->set("foo", "bar"), with no ttl.

パラメータ

key

The property name, used as the cache key.

value

The value to store. Every PHP type except resource can be stored.

戻り値

Returns the stored value.

例

例1 Yac::__set() example

<?php
$yac = new Yac();

$yac->foo = "bar";          // stored without a ttl
var_dump($yac->get("foo")); // string(3) "bar"
?>

参考

関連キーワード:
property   Store   using   syntax   cache   stored   mixed   音声   フォーマット   操作   Stores   invoked   writing   instance   equivalent   used   store   type   except   resource   example   without   dump   参考   Retrieve
関連する関数・ページ:
yac.getter   class.yac   yac.set   function.uopz-get-property   book.yac   yac.add