title: How to set a parent property from inherited class
body: <p>I have this two classes:</p>
  
  <pre><code>&lt;?php
  
  class Test 
  {
      protected $x = 0;
  
      public function setX($x)
      {
          $this-&gt;x = $x;
      }
  
      public function getX()
      {
          echo $this-&gt;x;
      }
  }
  
  
  class TestEx extends Test
  {
      //parent::$this-&gt;x = 7; it gives this error: Parse error: syntax error, unexpected '$x' (T_VARIABLE), expecting function (T_FUNCTION) in test.php
  
      public function getX()
      {
          echo parent::$this-&gt;x;
      }
  
  }
  
  
  
  $call_textex = new TestEx();
  $call_textex-&gt;getX();
  
  
  ?&gt;
  </code></pre>
  
  <p>Now, I would to set $x property of base class from the inherited class. How to achieve that in PHP5?</p>