Is Dynamic Polymorphism in PHP is supported like template classes or is the only way in using Polymorphism in PHP is abstract functions and overloading/overriding ?
This should enlighten you: http://net.tutsplus.com/tutorials/php/understanding-and-applying-polymorphism-in-php/
There is nothing like Template Classes, but you can very much achieve different runtime behavior through the use Abstract Classes and Interfaces as well as the utilization of Design Patterns like State, Decorator, Strategy and others.
related: Is what seems like polymorphism in PHP really polymorphism?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With