Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Father {
- static function hi() {
- echo "Father" . PHP_EOL;
- }
- }
- class Guy extends Father {
- static function hi() {
- echo "Guy" . PHP_EOL;
- }
- static function test() {
- echo self::class;
- self::hi();
- echo static::class;
- static::hi();
- echo parent::class;
- parent::hi();
- $anon = function() {
- self::hi();
- echo self::class;
- echo static::class;
- static::hi();
- echo parent::class;
- parent::hi();
- };
- $anon();
- }
- }
- class Child extends Guy {
- static function hi() {
- echo "Child" . PHP_EOL;
- }
- }
- Child::test();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement