<?php
namespace Example;
class Parent_ {
public function whoAmI
(): array {
return [__CLASS__, self::class, static::class];
}
}
class Child extends Parent_ {}
$parent = new Parent_();
$child = new Child();
var_dump($parent->whoAmI(), $child->whoAmI());
PD9waHAKCm5hbWVzcGFjZSBFeGFtcGxlOwoKY2xhc3MgUGFyZW50XyB7CglwdWJsaWMgZnVuY3Rpb24gd2hvQW1JKCk6IGFycmF5Cgl7CgkJcmV0dXJuIFtfX0NMQVNTX18sIHNlbGY6OmNsYXNzLCBzdGF0aWM6OmNsYXNzXTsKCX0KfQoKY2xhc3MgQ2hpbGQgZXh0ZW5kcyBQYXJlbnRfIHt9CgokcGFyZW50ID0gbmV3IFBhcmVudF8oKTsKJGNoaWxkID0gbmV3IENoaWxkKCk7Cgp2YXJfZHVtcCgkcGFyZW50LT53aG9BbUkoKSwgJGNoaWxkLT53aG9BbUkoKSk7