I understand the way you extend
a class like ChildClass extends ParentClass
, I understand use of class abstraction
and interfaces
, and I do understand traits
In the articles I have read most of people stated that traits is used in practice to achieve multiple inheritance that is not done by extends
functionality as it supports only single extension.
As I understand traits it is more of a collection of functions that can be used by different classes or other traits.
In this question I ask you to tell me how is it correctly done to literally do extension of more than one class not adding some function-collection.