<?php

class A {
    public function test() {
        echo self::who();   // always class A
        echo static::who(); // always the current class (static context)
        echo $this->who();  // always the current class (object context)
    }
    public function who() {
        echo __CLASS__ . "\n";
    }
}

class B extends A {
    public function who() {
        echo __CLASS__ . "\n";
    }
}

class C extends B {
    public function who() {
        echo __CLASS__ . "\n";
    }
}

(new B)->test();
(new C)->test();
C::test();
