· PHP – Syntax – OOP – Terms – Polymorphism
- Polymorphism comes from Greek and means "having
- Polymorphism allows to redifine (morph) behaviour depending
- 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.