Traits vs. interfaces

I’ve been trying to study up on PHP lately, and I find myself getting hung up on traits. I understand the concept of horizontal code reuse and not wanting to necessarily inherit from an abstract class. What I don’t understand is: What is the crucial difference between using traits versus interfaces?

I’ve tried searching for a decent blog post or article explaining when to use one or the other, but the examples I’ve found so far seem so similar as to be identical.

13 Answers
13

Leave a Comment