title: Private access in inheritance
body: <pre><code>class  Person {
      public  $name;
      private $age; //private access
  }
  
  class Employee extends Person{
      public $id;
      public $salary; //class property   
  }
  
  $emp = new Employee(); 
  $emp-&gt;name="ABCD";
  $emp-&gt;age = 30;
  $emp-&gt;id=101;
  $emp-&gt;salary=20000;
  
  echo "&lt;br/&gt; Name : ".$emp-&gt;name;
  echo "&lt;br/&gt; Age : ".$emp-&gt;age;
  </code></pre>
  
  <p>In this code, the child class variable <code>$emp</code> can access private member of parent class <code>Person</code> directly. Is this not the violation of private access rule?</p>
  
  <p>It gives error when using a parent class variable, but works with child class variable!! Can anyone explain why?</p>