There is an interface that will be common to all objects:
interface Config_Interfacefunction { public function read($file){ echo 'read'.$file; } }
It is necessary to create several types of objects, each type of behavior which we describe in classes:
class Config_Config { public function Con(){ echo 'conf'; } } class Config_Config2 { public function Con(){ echo 'conf2'; } public function Joi(){ echo 'Joi'; } }
Now I want a general class that will create objects of different types, depending on the passed argument.
class Con { public $root=19; public function __construct($instance) { ..... } } $obj=new Con(new ......);//что здесь писать???