Advertisement
Guest User

Untitled

a guest
Aug 18th, 2017
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.29 KB | None | 0 0
  1. <?php
  2.  
  3. class x {
  4.     const a = -1;
  5.  
  6.     static function create() {
  7.         return self::a;
  8.     }
  9.  
  10.     static function create3() {
  11.         return static::a;
  12.     }
  13. }
  14.  
  15. class y extends x {
  16.     const a = 1;
  17.        
  18.     static function create2() {
  19.         return self::a;
  20.     }
  21. }
  22.  
  23. echo y::create();
  24. echo y::create3();
  25.  
  26. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement