Рет қаралды 5,675
Polymorphism is derived from two Greek words. Poly (meaning many) and morph (meaning forms). Polymorphism is one of the PHP Object Oriented Programming (OOP) features. In general, polymorphism means the ability to have many forms. If we say it in other words, "Polymorphism describes a pattern in Object Oriented Programming in which a class has varying functionality while sharing a common interfaces.". There are two types of Polymorphism; they are:
Compile time (function overloading)
Run time (function overriding)
But PHP "does not support" compile time polymorphism, which means function overloading and operator overloading.