Sr. PHP Programmer Question:

What are Traits?

Tweet Share WhatsApp

Answer:

Traits are a mechanism that allows you to create reusable code in languages like PHP where multiple inheritance is not supported. A Trait cannot be instantiated on its own.

It's important that a developer know the powerful features of the language (s)he is working on, and Trait is one of such features.

Read All 202 Senior PHP Programmer Questions
Previous QuestionNext Question
What is the purpose of $_SERVER variable in PHP?How will you access the error code associated with file upload in PHP?