fork(1) download
  1. <?php
  2.  
  3. // your code goes here
  4. class A {
  5. public function foo() {
  6. $this->a = 'it works';
  7. }
  8. }
  9.  
  10. class B extends A {
  11. public function bar() {
  12. return $this->a;
  13. }
  14. }
  15.  
  16. $b = new B();
  17. $b->foo();
  18. echo $b->bar();
  19.  
Success #stdin #stdout 0s 82880KB
stdin
Standard input is empty
stdout
it works