Overview
KB
Technical FAQ
PHP Manual
CSS2 Manual
HTML Manual
JS Guide
JS Reference
PhpDock Manual
Nu-Coder Manual
PhpExpress Manual
PHP Joomla
Development
Learn PHP
 
<Yac::setAudio Formats Manipulation>
^YacLast updated: Mon, 26 Oct 2026

Yac::__set

(PECL yac >= 1.0.0)

Yac::__set — Store a value using property syntax

Description

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.

Parameters

key

The property name, used as the cache key.

value

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

Return Values

Returns the stored value.

Examples

Example #1 Yac::__set() example

<?php
$yac = new Yac();

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

See Also


<Yac::setAudio Formats Manipulation>
^YacLast updated: Mon, 26 Oct 2026