What are traits in PHP?

Traits are a kind of method that allows us to reuse the code. They provide a means to mitigate the constraints of single inheritance by allowing us to freely reuse sets of methods across multiple classes that exist in separate class hierarchies.


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *