title: Child and parent class property
body: <p>I have a class with a name <code>Parent</code> and a class <code>Child</code> that inherits <code>Parent</code> class.<code>Parent</code> class has a property <code>filename</code> with value <code>testfile</code>.In the first step I change the value of this property for example on <code>anothertestvalue</code> in <code>Parent</code> class <code>testFileame</code> method.Then I try to  call method <code>log</code> from <code>Child</code> class and this method try to get <code>filename</code> property from <code>Parent</code> class.</p>
  
  <pre><code>class Parent {
       public $filename = 'filename';
  
       public function  setFilename() {
            $this-&gt;filename = 'anotherfilename'
       }
  
       public function log($message, $this-&gt;filename) {
            //here filename from Child class has value 'filename' but I expect 'anotherfilename'
       }
  }
  
  class Child extends Parent {
      $this-&gt;log("somemessage");
  }
  </code></pre>
  
  <p>I expect to get <code>anothertestvalue</code> value but method uses <code>testfile</code>.Can someone explain what happens?</p>