Traits in php

Traits in php provide a mechanism for reusing code outside of a class hierarchy. Traits allow you to share functionality across different classes that don’t (and shouldn’t) share a common ancestor in a class hierarchy. trait traitname [ extends baseclass ]{[ use traitname, [ traitname, … ]; ][ visibility $property [ = value ]; … … Read more