title: Warning: Missing argument 1 for Personnage::__construct()
body: <p>I am receiving following error for my code. Please help me out. </p>
  
  <blockquote>
    <p>Warning: Missing argument 1 for Personnage::__construct(), called in
    public_html/PooEnPhp/index.php on line 24 and defined in
    public_html/PooEnPhp/Personnage.class.php on line 22</p>
  </blockquote>
  
  <p>Class file : Personnage.class.php </p>
  
  <pre><code>&lt;?php
  
  class Personnage {
  
      private $_force =  20;
      private $_localisation = 'Lyon';
      private $_experience = 0;
      private $_degats = 0;
  
  
  
      // Create a connstructor with two arguments
      public function __construct($force, $degats) {
          echo 'Voici le constructeur ! '; 
          $this-&gt;_force = $force;
          $this-&gt;_degats = $degats;
      }
  </code></pre>
  
  <p>The file instantiating the Personnage class:  index.php</p>
  
  <pre><code>&lt;?php
  
              function chargerClasse($classe) {
                  require $classe . '.class.php'; 
              }
  
              //autoload the function chargerClasse
              spl_autoload_register('chargerClasse');
  
             // instantiate the Personnage class using the default constructor (the one implied without argument)
              $perso = new Personnage(); 
  </code></pre>
  
  <p>Normally in index.php I should be able to instanciate the the Personnage class using the implied default  constructor __construct().</p>
  
  <p>But I am getting the error above. Can somebody explain me why ?</p>
  
  <p>Thanks </p>