How is traits used in php?



How is traits used in php?..

Answer / Amrat Singh

Traits are a mechanism for code reuse in PHP. They allow you to reuse functions and properties from one class into another, even if they don't share a common ancestor. Traits are defined using the trait keyword.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More PHP Interview Questions

What is php dependency injection?

1 Answers  


Explain the types of string comparision function in PHP

1 Answers  


How be the result set of mysql handled in php?

1 Answers  


What is php session and how it works?

1 Answers  


What is the use of addslashes in php?

1 Answers  


Explain how you can update memcached when you make changes to php?

1 Answers  


What is the exact Diff. between include_once() and require_once() in PHP?

12 Answers  


What is the difference between characters 34 and x34?

1 Answers  


What is php pathinfo?

1 Answers  


What is the function mysql_pconnect() useful for?

1 Answers  


Why php is also called as scripting language?

1 Answers  


How to convert a string to uppercase in php?

1 Answers  


Categories