Various design patterns using PHP to solve different problems