1.

What are traits?

Answer»

TRAITS are a mechanism that LETS you create reusable code in PHP and similar LANGUAGES where multiple inheritances are not supported. It’s not possible to instantiate it on its own.

A trait is INTENDED to reduce the limitations of single inheritance by ENABLING a developer to reuse sets of methods freely in many independent classes living in different hierarchies of class.



Discussion

No Comment Found