<slide title="New APC Features">

<break lines="1" />

<list>
<bullet>Better memory handling when getting near the shared memory limit.</bullet>
<bullet>user-level access to store PHP variables in shared memory easily.</bullet>
<bullet>Quick way to load constants from shared memory</bullet>
</list>

<example title="apc_store/fetch"><![CDATA[<?php
  $a = array(1,2,3);
  apc_store('my_array', $a, 5);
  $a = 0;
  echo "<pre>"; var_dump($a); echo "</pre>";
  $b = apc_fetch('my_array');
  echo "<pre>"; var_dump($b); echo "</pre>";
?>]]></example>

<!-- Cheating to make sure the slide will work without APC -->
<example hide="1" result="1"><![CDATA[<?php
  $a = array(1,2,3);
  $b = $a;
  $a = 0;
  echo "<pre>"; var_dump($a); echo "</pre>";
  echo "<pre>"; var_dump($b); echo "</pre>";
?>]]></example>

<break lines="1" />

<example title="save/load constants"><![CDATA[<?php
  if(!apc_load_constants('my_constants')) {
    $constants = array('ABC'=>'testing',
                       'DEF'=>123,
                       'FOO'=>'Bar');
    apc_define_constants('my_constants', $constants);
  }
?>]]></example>
</slide>
