Design Pattern: Decorator Pattern in PHP
Decorator pattern dynamically attaches additional responsibility to an object. This pattern is used to extend functionality without affecting the existing implementation. If we just use inheritance, then we can extend the functionality of a class. But by using a decorator we can enhance/extend and/or change the functionality of an object at run time. This article demonstrates Decorator pattern implementation in PHP.