Advertisement
Guest User

Untitled

a guest
Sep 25th, 2017
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.21 KB | None | 0 0
  1. class a {
  2.  
  3. public $x = 0;
  4.  
  5. function foo() {
  6. $this->x = 1;
  7. }
  8. }
  9.  
  10. class b extends a {
  11.  
  12. public $x = 3;
  13.  
  14. function bar() {
  15. a::foo();
  16. }
  17. }
  18.  
  19. $b = new b();
  20. $b->bar();
  21. echo $b->x;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement