title: PHP Classes - Fatal error: Call to undefined method
body: <p>test.php</p>
  
  <pre><code>class AClass {
      public function __construct()
      {
          echo '&lt;strong style="color:blue;"&gt;AClass construct&lt;/strong&gt;&lt;br&gt;';
      }
  
      public function call()
      {
          $this-&gt;koko();
      }
  
      private function koko()
      {
          echo 'koko &lt;br&gt;';
      }
  }
  
  class BClass extends AClass {
  
      public function __construct()
      {
          echo '&lt;strong style="color:red;"&gt;BClass construct&lt;/strong&gt;&lt;br&gt;';
          parent::__construct();
      }
  
      public function momo()
      {
          echo 'momo &lt;br&gt;';
      }
  }
  
  
  $xxx = new AClass(); // Output: AClass contruct ..... (where is BClass echo ?)
  $xxx-&gt;call(); // Output: koko
  $xxx-&gt;momo(); // Output: Fatal error: Call to undefined method AClass:momo()
  </code></pre>
  
  <p>Maybe newbe question but.... What is wrong ?</p>