<?php trait SmartObject { public function __call(string $name, array $args) { return 'smart ' . $name; } } class Component { use SmartObject; } class FormControl extends Component { public function __call(string $name, array $args): mixed { return 'control ' . $name; } } class CustomFormControl extends FormControl { //use SmartObject; } var_dump((new FormControl)->foo()); var_dump((new CustomFormControl)->foo());
You have javascript disabled. You will not be able to edit any code.