fork download
  1. <?php
  2.  
  3. class B {
  4. public function f() {
  5. $this->g();
  6. $this->h();
  7. $this->i();
  8. }
  9.  
  10. public function g() {
  11. echo 'B::g' . "\n";
  12. }
  13.  
  14. protected function h() {
  15. echo 'B::h' . "\n";
  16. }
  17.  
  18. private function i() {
  19. echo 'B::i' . "\n";
  20. }
  21. }
  22.  
  23. class D extends B {
  24. public function g() {
  25. echo 'D::g' . "\n";
  26. }
  27.  
  28. public function h() {
  29. echo 'D::h' . "\n";
  30. }
  31.  
  32. public function i() {
  33. echo 'D::i' . "\n";
  34. }
  35. }
  36.  
  37. $d = new D();
  38. $d->f();
  39.  
Success #stdin #stdout 0.02s 20568KB
stdin
Standard input is empty
stdout
D::g
D::h
B::i