title: Does php autoloader cache results>
body: <p>I'm a little confused. I have code that looks like this:</p>
  
  <pre><code>var_dump(class_exists ("blah\myclass"));
  include_once("Autoloader.php"); //this file creates the function, and does spl_autoload_register('Autoloader::loader');
  
  var_dump(class_exists ("blah\myclass")); //line3
  spl_autoload_unregister('Autoloader::loader');
  
  var_dump(class_exists ("blah\myclass"));
  </code></pre>
  
  <p>I expected the output to show: 
    <code>false</code>, <code>true</code>, <code>false</code>.</p>
  
  <p>But I'm getting: 
    <code>false</code>, <code>true</code>, <code>true</code>.</p>
  
  <p>At first, I thought maybe I just wasn't unregistering correctly, but if I take out line 3, I get what I'd expect:<br>
    <code>false</code>, <code>false</code>  </p>
  
  <p>I'm trying to understand what's going on.  Is PHP caching the class definition the first time it instantiates the class?  And if so, does that mean <code>spl_autoload_unregister</code> is no longer useful after the 1st time the class is found?</p>
  
  <p>Thanks for any clarifications.</p>