Head First Design Patterns code example  in php