<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/class.yac.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'en',
  ),
  'this' => 
  array (
    0 => 'yac.getter.php',
    1 => 'Yac::__get',
    2 => 'Retrieve a value using property syntax',
  ),
  'up' => 
  array (
    0 => 'class.yac.php',
    1 => 'Yac',
  ),
  'prev' => 
  array (
    0 => 'yac.get.php',
    1 => 'Yac::get',
  ),
  'next' => 
  array (
    0 => 'yac.info.php',
    1 => 'Yac::info',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/yac/yac/getter.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="yac.getter" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">Yac::__get</h1>
  <p class="verinfo">(PECL yac &gt;= 1.0.0)</p><p class="refpurpose"><span class="refname">Yac::__get</span> &mdash; <span class="dc-title">Retrieve a value using property syntax</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-yac.getter-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="modifier">function</span> <span class="methodname"><strong>Yac::__get</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$key</code></span>): <span class="type"><a href="language.types.mixed.php" class="type mixed">mixed</a></span></div>

  <p class="simpara">
   Retrieves a value from the cache, invoked when reading a property of a
   <span class="classname"><a href="class.yac.php" class="classname">Yac</a></span> instance: <code class="literal">$yac-&gt;foo</code> is
   equivalent to <code class="literal">$yac-&gt;get(&quot;foo&quot;)</code>.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-yac.getter-parameters">
  <h3 class="title">Parameters</h3>
  <dl>
   
    <dt><code class="parameter">key</code></dt>
    <dd>
     <p class="simpara">
      The property name, used as the cache key.
     </p>
    </dd>
   
  </dl>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-yac.getter-returnvalues">
  <h3 class="title">Return Values</h3>
  <p class="simpara">
   The cached value on a hit, <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong> when the key is not present in the
   cache.
  </p>
  <blockquote class="note"><p><strong class="note">Note</strong>: 
   <p class="simpara">
    Unlike <span class="methodname"><a href="yac.get.php" class="methodname">Yac::get()</a></span>, property syntax cannot
    distinguish a stored <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong> from a missing key, and only supports
    single keys.
   </p>
  </p></blockquote>
 </div>


 <div class="refsect1 examples" id="refsect1-yac.getter-examples">
  <h3 class="title">Examples</h3>
  <div class="example" id="example-1">
   <p><strong>Example #1 <span class="methodname"><strong>Yac::__get()</strong></span> example</strong></p>
   <div class="example-contents">
<div class="phpcode"><pre><code style="color: #000000"><span style="color: #0000BB">&lt;?php
$yac </span><span style="color: #007700">= new </span><span style="color: #0000BB">Yac</span><span style="color: #007700">();
</span><span style="color: #0000BB">$yac</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">set</span><span style="color: #007700">(</span><span style="color: #DD0000">"foo"</span><span style="color: #007700">, </span><span style="color: #DD0000">"bar"</span><span style="color: #007700">);

</span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$yac</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">foo</span><span style="color: #007700">);       </span><span style="color: #FF8000">// string(3) "bar"
</span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$yac</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">missing</span><span style="color: #007700">);   </span><span style="color: #FF8000">// NULL
</span><span style="color: #0000BB">?&gt;</span></code></pre></div>
   </div>

  </div>
 </div>


 <div class="refsect1 seealso" id="refsect1-yac.getter-seealso">
  <h3 class="title">See Also</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="methodname"><a href="yac.get.php" class="methodname" rel="rdfs-seeAlso">Yac::get()</a> - Retrieve values from cache</span></li>
    <li><span class="methodname"><a href="yac.setter.php" class="methodname" rel="rdfs-seeAlso">Yac::__set()</a> - Store a value using property syntax</span></li>
   </ul>
  </p>
 </div>


</div><?php manual_footer($setup); ?>