NYCPHP Meetup

NYPHP.org

[nycphp-talk] PHP 5.4.0

Chris Snyder chsnyder at gmail.com
Fri Mar 2 12:23:29 EST 2012


On Fri, Mar 2, 2012 at 12:06 PM, Federico Ulfo <rainelemental at gmail.com> wrote:
> I've to correct what I wrote before about traits.
>
> PHP 5.4 implements traits instead of multiple inheritance, because the
> multiple inheritance can cause the "diamond problem"
> http://en.wikipedia.org/wiki/Diamond_problem

That article explains in detail how the problem is handled in other
languages. And traits can still result in conflicts that look pretty
darned similar to the diamond problem, which result in a fatal error.

So I think your question is still a good one. Nevertheless, I'm glad
we've got another way to reduce the amount of boilerplate in our
classes.



More information about the talk mailing list