suite a une discussion sur 4chan, je voulais avoir votre avis. le code suivant est il polymorphique ? http://ideone.com/I0wbX2
pour certains oui, pour d'autre non car les deux classes ne partage pas un parent commun et n'est que du duck typing.
dans le livre du gang of four on peu lire:
"Dynamic binding means that issuing a request doesn't commit you to a particular
implementation until run-time. Consequently, you can write programs that expect
an object with a particular interface, knowing that any object that has the correct
interface will accept the request. Moreover, dynamic binding lets you substitute
objects that have identical interfaces for each other at run-time. This
substitutability is known as polymorphism, and it's a key concept in
object-oriented systems. It lets a client object make few assumptions about other
objects beyond supporting a particular interface. Polymorphism simplifies the
definitions of clients, decouples objects from each other, and lets them vary
their relationships to each other at run-time. "
donc je sais pas trop quoi penser.