title: require_once Fatal error: Class not found
body: <p>I'm baffled by this - it works if I restart the web server but then will fail again. I've tried it on 2 different servers</p>
  
  <p>PHP 5.5.3 with Apache 2.4.6</p>
  
  <p>PHP 5.5.9 with nginx 1.4.6</p>
  
  <pre><code>require_once('myclass.php');
  class mynewclass extends myclass {
      // Fatal error: Class 'myclass' not found in ...
  }
  </code></pre>
  
  <p>But if I try this I get <code>Fatal error: Cannot redeclare class myclass</code> in ...</p>
  
  <pre><code>require_once('myclass.php');
  if (!class_exists('myclass')) {
      require('myclass.php');
      // Fatal error: Cannot redeclare class myclass` in ...
  }
  class mynewclass extends myclass {
  
  }
  </code></pre>