Object-oriented languages, like C++, Java and PHP, implement what is called single dispatch: when you have an object in a variable and you call a method on this variable, the message is dispatched to the right class at runtime, even if when you write the code you do not want to tie the call to a particular implementation. Polymorphism is an example of this mechanism in action.