Sophie

Sophie

distrib > Mageia > 7 > i586 > by-pkgid > 2b917e0437961edec048f1d15e2d7449 > files > 407

php-manual-en-7.2.11-1.mga7.noarch.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Retrieve the contents of the cache</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="cachingiterator.current.html">CachingIterator::current</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="cachingiterator.getflags.html">CachingIterator::getFlags</a></div>
 <div class="up"><a href="class.cachingiterator.html">CachingIterator</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="cachingiterator.getcache" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">CachingIterator::getCache</h1>
  <p class="verinfo">(PHP 5 &gt;= 5.2.0, PHP 7)</p><p class="refpurpose"><span class="refname">CachingIterator::getCache</span> &mdash; <span class="dc-title">Retrieve the contents of the cache</span></p>

 </div>
 
 <div class="refsect1 description" id="refsect1-cachingiterator.getcache-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">array</span> <span class="methodname"><strong>CachingIterator::getCache</strong></span>
    ( <span class="methodparam">void</span>
   )</div>

  <p class="para rdfs-comment">
   Retrieve the contents of the cache.
  </p>
  <blockquote class="note"><p><strong class="note">Note</strong>: 
   <p class="para">
    The <strong><code>CachingIterator::FULL_CACHE</code></strong> flag
    must be being used.
   </p>
  </p></blockquote>
 </div>


 <div class="refsect1 parameters" id="refsect1-cachingiterator.getcache-parameters">
  <h3 class="title">Parameters</h3>
  <p class="para">This function has no parameters.</p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-cachingiterator.getcache-returnvalues">
  <h3 class="title">Return Values</h3>
  <p class="para">
   An <span class="type"><a href="language.types.array.html" class="type array">array</a></span> containing the cache items.
  </p>
 </div>


 <div class="refsect1 errors" id="refsect1-cachingiterator.getcache-errors">
  <h3 class="title">Errors/Exceptions</h3>
  <p class="para">
   Throws a <a href="class.badmethodcallexception.html" class="classname">BadMethodCallException</a> when the
   <strong><code>CachingIterator::FULL_CACHE</code></strong> flag is not being used.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-cachingiterator.getcache-examples">
  <h3 class="title">Examples</h3>
  <p class="para">
   <div class="example" id="example-4764">
    <p><strong>Example #1 <span class="methodname"><strong>CachingIterator::getCache()</strong></span> example</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />$iterator&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;</span><span style="color: #0000BB">ArrayIterator</span><span style="color: #007700">(array(</span><span style="color: #0000BB">1</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">2</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">3</span><span style="color: #007700">));<br /></span><span style="color: #0000BB">$cache&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;</span><span style="color: #0000BB">CachingIterator</span><span style="color: #007700">(</span><span style="color: #0000BB">$iterator</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">CachingIterator</span><span style="color: #007700">::</span><span style="color: #0000BB">FULL_CACHE</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">$cache</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">next</span><span style="color: #007700">();<br /></span><span style="color: #0000BB">$cache</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">next</span><span style="color: #007700">();<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$cache</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getCache</span><span style="color: #007700">());<br /><br /></span><span style="color: #0000BB">$cache</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">next</span><span style="color: #007700">();<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$cache</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getCache</span><span style="color: #007700">());<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

    <div class="example-contents"><p>The above example will output:</p></div>
    <div class="example-contents screen">
<div class="cdata"><pre>
array(2) {
  [0]=&gt;
  int(1)
  [1]=&gt;
  int(2)
}
array(3) {
  [0]=&gt;
  int(1)
  [1]=&gt;
  int(2)
  [2]=&gt;
  int(3)
}
</pre></div>
    </div>
   </div>
  </p>
 </div>


</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="cachingiterator.current.html">CachingIterator::current</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="cachingiterator.getflags.html">CachingIterator::getFlags</a></div>
 <div class="up"><a href="class.cachingiterator.html">CachingIterator</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>