title: PHP Accessing Parent Class Variable
body: <pre><code>class A {
      private $aa;
      protected $bb = 'parent bb';
  
      function __construct($arg) {
         //do something..
      }
  
      private function parentmethod($arg2) {
         //do something..
      }
  }
  
  class B extends A {
      function __construct($arg) {
          parent::__construct($arg);
      }
      function childfunction() {
          echo parent::$bb; //Fatal error: Undefined class constant 'bb' 
      }
  }
  
  $test = new B($some);
  $test-&gt;childfunction();
  </code></pre>
  
  <p>Question:
  How do I display parent variable in child?
  expected result will echo 'parent bb'</p>