design pattern examples in php