title: PHP OOP: difference between parent and $this when accessing protected method
body: <p>Is there any difference between parent and <code>$this</code> when calling protected properties or method from extended class? for example:</p>
  
  <pre><code>&lt;?php 
  class classA  
  {  
      public $prop1 = "I'm a class property!";  
      public function setProperty($newval)  
      {  
          $this-&gt;prop1 = $newval;  
      }  
      protected function getProperty()  
      {  
          return $this-&gt;prop1 . "&lt;br /&gt;";  
      }  
  }  
  
  class classB extends classA  
  {  
      public function callProtected()  
      {  
          return $this-&gt;getProperty();  
      } 
      public function callProtected2()  
      {  
          return parent::getProperty();   
      }
  }  
  
  $testobj = new classB;  
  
  echo $testobj-&gt;callProtected();  
  echo $testobj-&gt;callProtected2(); 
  ?&gt; 
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>I'm a class property!
  I'm a class property!
  </code></pre>