Re: RFC: Traits for PHP

From: Date: Tue, 19 Feb 2008 23:30:59 +0000
Subject: Re: RFC: Traits for PHP
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-35627@lists.php.net to get a copy of this message
On Feb 19, 2008 11:45 PM, Lars Strojny <lars@strojny.net> wrote: > I think also for > the sake of conceptual integrity separating interfaces clearly from > traits is a good idea: interfaces define structure while traits are > function buckets. A class may use traits, may implement interfaces and > may extend another class. This paradigm is pretty easy to explain to the > user. Definitely. Class inheritance (The `extends` keyword) inherits type + implementation. Interface inheritance (The `implements` keyword) inherits type (but not implementation). Traits fill the missing hole by allowing inheritance of implementation, but not type. -- troels

« previous php.internals (#35627) next »