Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class A
- {
- static public $name = 'zir4onah';
- static public function name()
- {
- return static::$name;
- }
- }
- class B extends A
- {
- static public $name = 'qwe';
- public function getName()
- {
- return B::name();
- }
- }
- /** If STATIC:: return static::$name; i can return B::name = 'qwe' else if SELF:: return self::$name; return 'zir4onah' */
- $a = new B();
- $x = B::name(); // return qwe because static::$name;
- $b = $a->getName();
Add Comment
Please, Sign In to add comment