rfc:traits-with-interfaces
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
rfc:traits-with-interfaces [2016/02/18 21:10] – v 0.2, splitting into two proposals kevingessner | rfc:traits-with-interfaces [2017/09/22 13:28] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 50: | Line 50: | ||
//This proposal depends on Proposal 1, above.// | //This proposal depends on Proposal 1, above.// | ||
- | A trait that implements an interface provides methods that fulfill the interface’s contract. | + | A trait that implements an interface provides methods that fulfill the interface’s contract. |
Concretely, Proposal 2 makes this code be valid and functional: | Concretely, Proposal 2 makes this code be valid and functional: | ||
Line 77: | Line 77: | ||
Classes that insert the trait may override any members (as with existing traits) and continue to implement the interface. | Classes that insert the trait may override any members (as with existing traits) and continue to implement the interface. | ||
- | This change reduces the overhead of implementing an interface via a trait, because a class will only need to implement | + | This change reduces the overhead of implementing an interface via a trait, because a class will only need to insert |
Other languages that implement languages features like PHP’s traits allow for interface specifications like this RFC. See “References” for links. | Other languages that implement languages features like PHP’s traits allow for interface specifications like this RFC. See “References” for links. | ||
Line 269: | Line 269: | ||
Language spec patch, covering Proposal 1: https:// | Language spec patch, covering Proposal 1: https:// | ||
- | Other patches TBD. | + | php-src patch implementing Proposal 1: https:// |
===== Implementation ===== | ===== Implementation ===== |
rfc/traits-with-interfaces.1455829820.txt.gz · Last modified: 2017/09/22 13:28 (external edit)