I think interfaces are a little deeper than adding type hints and a
function checklist to be fair :). They were introduced into Java as a
solution to the fact that it (like PHP) has single object inheritance
and you could therefore not have multiple inheritance like C++ does. So
in effect, an interface is analogous to a base class and passing an
object that implements an interface to a method is stating that the
object can be treated as if it were an instance of that class. PHP does
also error if you declare a class as implementing an interface and you
have not implemented all the declared methods.
I am probably being over zealous as my background is in Java and C++, I
have only really become interested in PHP over the last couple of years
and it should never be forgotten that PHP is an interpreted language
whose main reason of existence is to deliver web pages as quickly as
possible. Adding interface dependencies to everything would indeed be
ludicrous. I just found it nice to have in Sockets since it made my own
socket more flexible without the need to inherit behaviour from
HttpSocket or CakeSocket and testing so much easier.
With regard to breaking backwards compatibility though, why can you not
modify interfaces ? As long as the modification is backwardly
compatible just as it would have to be with classes and there is nothing
to stop you extending an interface and marking the original as
deprecated would there be a problem ?
Steve (Ratty)