Experimental implementation of factory-pattern with PHP.