What is a trait in PHP used for?
- A Reusing methods across classes that share no common ancestor
- B Defining constants
- C Creating database models
- D Handling exceptions
Answer
Reusing methods across classes that share no common ancestor
Traits are PHP's answer to the absence of multiple inheritance. Overusing them scatters a class's behaviour across many files.





