Porting from Java to PHP factory pattern examples found in HF Desing Patterns.