title: PHP properties overloading
body: <p>What's wrong with the following code?</p>
  <p>$inFile and $outFile get initialized ALWAYS by machine1 and not by machine2, which means that with an instance of machine2 the config of machine1 gets opened (and written).</p>
  <p>What am I doing wrong?
  I understood that <code>$this-&gt;somevar</code> refers to the object actually instantiated (machine2).</p>
  <p>Thanks.</p>
  <pre><code>class machine1
  {
      private  $inFile = &quot;Config.ini&quot;;
      private  $outFile = &quot;Config.web&quot;;
      
      public $fileArray = array();
      
      
      public function LoadData()
      {
          $handle = fopen(paths::$inifiles . $this-&gt;inFile,&quot;r&quot;);
          // Read the file
          fclose($handle);
      }
      
      public function SaveData()
      {
          $handle = fopen(paths::$inifiles . $this-&gt;outFile,&quot;w&quot;);
          //write the file
          fclose($handle);
      }
  }
  class machine2 extends machine1
  {
      private  $inFile = &quot;Config_1.ini&quot;;
      private  $outFile = &quot;Config_1.web&quot;;
  }
  
  $obj = new machine2();
  $obj-&gt;LoadData();
  $obj-&gt;SaveData();
  </code></pre>