Guest User

Untitled

a guest
Jul 23rd, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. <?php
  2.  
  3. class mA
  4. {
  5. const TEST = 'mA';
  6.  
  7. public function getSelf()
  8. {
  9. return self::TEST;
  10. }
  11.  
  12. public function getThis()
  13. {
  14. return $this::TEST;
  15. }
  16. }
  17.  
  18. class mB extends mA
  19. {
  20. const TEST = 'mB';
  21. }
  22.  
  23. $t = new mB();
  24.  
  25. echo "getSelf : " . $t->getSelf()."\n";
  26. echo "getThis : " . $t->getThis()."\n";
Add Comment
Please, Sign In to add comment