title: multiple spl_autoload_register issue
body: <p>I'm working on the development of a custom framework.
  And I have encountered an issue when I tried to dynamise the calling of my classes.</p>
  
  <p>This is a visual of my files :</p>
  
  <p><img src="https://i.stack.imgur.com/Nybt9.png" alt="enter image description here"></p>
  
  <p>So I decided to create a different function for each folder (libs, controllers et modeles):</p>
  
  <pre><code>function autoloadLibs($class) {
      //require the general classes
      require 'libs/' . $class . '.php';
  }
  
  function autoloadModels($class) {
      //require the models classes
      require 'models/' . $class . '.php';
  }
  
  function autoloadControllers($class) {
      //require the controllers classes
      require 'controllers/' . $class . '.php';
  }
  
  spl_autoload_register ('autoloadLibs');
  spl_autoload_register ('autoloadControllers');  
  spl_autoload_register ('autoloadModels');
  </code></pre>
  
  <p>Nevertheless I have this message : <strong>Warning: require(libs/admin.php): failed to open stream</strong>, of cours it's not the good folder. But I don't know how to fix that. Is there a good way to optimise my classes calls ?</p>