PHP Syntax OOP Terms Polymorphism

 

- Info:

- Polymorphism comes from Greek and means "having multiple forms".

- Polymorphism allows to redifine (morph) behaviour depending on context.

- For instance if Soldier extends Persons and they both have method fight() implementation might be different.

When you call Soldier.fight() he might use gun and when you call Person.fight() he might use fists.

They both possess the same type of behaviout (to fight) but they express it (implement it) differently.