Re: Grafts, Traits, horizontal reuse

From: Date: Wed, 26 Nov 2008 23:07:44 +0000
Subject: Re: Grafts, Traits, horizontal reuse
References: 1 2 3 4 5  Groups: php.internals 
Request: Send a blank email to internals+get-42063@lists.php.net to get a copy of this message
On Nov 24, 2008, at 9:27 PM, Christopher Vogt wrote:
Interfaces are helpful in combination with type hinting, but for people who prefer duck typing, it is reasonable to not explicitly define them.
It sounds like you are saying that if you prefer duck typing then interfaces have no use. If this is what you mean, I disagree strongly. Interfaces are primarily to create a set of methods that define an interface. Then the compiler can enforce implementation of that interface in any class that claims to implement the interface. This is the core utility of interfaces. Alan

« previous php.internals (#42063) next »