title: What is the proper way to extend a class in another file?
body: <p>This is what I have in foo.php</p>
  
  <pre><code>class Foo
  {
      public $foo = NULL;
      public $foo2 = NULL;
  
      public function setFoo ($foo, $foo2)
      {
         $this-&gt;foo = $foo;
         $this-&gt;foo2 = $foo2'
      }
  }
  </code></pre>
  
  <p>This is what I have in foo3.php</p>
  
  <pre><code>class Foo3 extends Foo
  {
      public $foo3 = NULL;
  
      public function setFoo3 ($foo3)
      {
         $this-&gt;foo = $foo3;
      }
  }  
  </code></pre>
  
  <p>This is how I require it in my third file run.php:</p>
  
  <pre><code>require_once "foo.php";
  require_once "foo3.php";
  $foo = new Foo();
  $foo-&gt;setFoo3("hello");
  </code></pre>
  
  <p>I get this error:</p>
  
  <p>Fatal error: Call to undefined method Foo::setFoo3()</p>
  
  <p>I'm not sure if the problem is how I'm requiring them. Thanks.</p>