title: PHP - require_once and class inheritance issue
body: <p>I get a fatal error: <code>Fatal error: Class 'Foo1' not found in .../Foo2.php on line 5</code> with the following files:</p>
  
  <p><em>index.php:</em></p>
  
  <pre><code>&lt;?php
  require_once("./Foo1.php");
  ?&gt;
  &lt;h1&gt;Success&lt;/h1&gt;
  </code></pre>
  
  <p><em>Foo1.php:</em></p>
  
  <pre><code>&lt;?php
  require_once('./IFoo.php');
  require_once('./Bar.php');
  
  class Foo1 implements IFoo
  {
      /** @var  Bar */
      private $bar;
  }
  </code></pre>
  
  <p><em>IFoo.php:</em></p>
  
  <pre><code>&lt;?php
  interface IFoo {
  }
  </code></pre>
  
  <p><em>Bar.php:</em></p>
  
  <pre><code>&lt;?php
  require_once('./Foo2.php');
  
  class Bar {
      /** @var  Foo2 */
      private $foo;
  }
  </code></pre>
  
  <p><em>Foo2.php:</em></p>
  
  <pre><code>&lt;?php
  require_once("./Foo1.php");
  
  class Foo2 extends Foo1
  {
  }
  </code></pre>
  
  <p>Questions:</p>
  
  <ol>
  <li>How to solve this situation?</li>
  <li>Why when I suppress the <code>implements IFoo</code> statements, this code works?</li>
  </ol>
  
  <hr>
  
  <p><strong>Update</strong>
  Most of the solutions proposed, involved <em>autoloading</em>. Unfortunately, my problem is on a old project with a lot of existing code and a lot of bad practice. We are really far from PSR-0 standard.</p>
  
  <p>What is the cost of introducing <em>autoloading</em> in terms of performances?</p>