А
Size: a a a
А
М
ДК
А
abstract class A
{
abstract protected function doA(): string;
final public function a(): string
{
....
return $this->doA();
}
}
abstract class B
{
abstract protected function doB(): string;
final public function b(): string
{
....
return $this->doB();
}
}
final class C extends A, B
{
protected function doA(): string
{
return 'A';
}
protected function doB(): string
{
return 'B';
}
}
echoA(A $a): void
{
$a->a();
}
echoB(B $b): void
{
$b->b();
}
echoA(new C());
echoB(new C());
М
DO
A
DO
y
DO
М
М
DO
М
М
М
М
DO
М
М